Commit 603f5959 by Dodji Seketeli Committed by Jakub Jelinek

re PR debug/39524 (Duplicate C++ DW_TAG_variable breaking its DW_AT_location resolution)

	PR debug/39524
	* dwarf2out.c (gen_variable_die): Avoid adding duplicate declaration
	nodes.

	* g++.dg/debug/dwarf2/imported-decl-1.C: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r145018
parent 27425fe7
2009-03-24 Dodji Seketeli <dodji@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR debug/39524
* dwarf2out.c (gen_variable_die): Avoid adding duplicate declaration
nodes.
2009-03-23 Jakub Jelinek <jakub@redhat.com> 2009-03-23 Jakub Jelinek <jakub@redhat.com>
PR c/39495 PR c/39495
......
...@@ -13978,6 +13978,14 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die) ...@@ -13978,6 +13978,14 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
return; return;
} }
/* If the compiler emitted a definition for the DECL declaration
and if we already emitted a DIE for it, don't emit a second
DIE for it again. */
if (old_die
&& declaration
&& old_die->die_parent == context_die)
return;
var_die = new_die (DW_TAG_variable, context_die, decl); var_die = new_die (DW_TAG_variable, context_die, decl);
origin_die = NULL; origin_die = NULL;
......
2009-03-24 Dodji Seketeli <dodji@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR debug/39524
* g++.dg/debug/dwarf2/imported-decl-1.C: New test.
2009-03-23 Jakub Jelinek <jakub@redhat.com> 2009-03-23 Jakub Jelinek <jakub@redhat.com>
PR c/39495 PR c/39495
......
// PR debug/39524
// { dg-do compile }
// { dg-options "-gdwarf-2 -dA -O0 -fno-merge-debug-strings" }
namespace A
{
static int var2 = 2;
}
int
func ()
{
using A::var2;
return var2;
}
// { dg-final { scan-assembler-times "var2\[^\n\r\]*DW_AT_name" 1 } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment