Commit 95a28767 by Jakub Jelinek Committed by Jakub Jelinek

dwarf2out.c (tree_add_const_value_attribute_for_decl): Don't add…

dwarf2out.c (tree_add_const_value_attribute_for_decl): Don't add DW_AT_const_value if VAR_DIE already has DW_AT_abstract_origin...

	* dwarf2out.c (tree_add_const_value_attribute_for_decl): Don't add
	DW_AT_const_value if VAR_DIE already has DW_AT_abstract_origin
	refering to a DIE with DW_AT_const_value.

	* gcc.dg/debug/dwarf2/inline3.c: New test.

From-SVN: r152535
parent 6c19d9b5
2009-10-07 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (tree_add_const_value_attribute_for_decl): Don't add
DW_AT_const_value if VAR_DIE already has DW_AT_abstract_origin
refering to a DIE with DW_AT_const_value.
2009-10-07 Vladimir Makarov <vmakarov@redhat.com>
PR middle-end/22072
......@@ -15701,6 +15701,10 @@ tree_add_const_value_attribute_for_decl (dw_die_ref var_die, tree decl)
else
return false;
/* Don't add DW_AT_const_value if abstract origin already has one. */
if (get_AT (var_die, DW_AT_const_value))
return false;
return tree_add_const_value_attribute (var_die, DECL_INITIAL (decl));
}
......
2009-10-07 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/debug/dwarf2/inline3.c: New test.
2009-10-07 Daniel Kraft <d@domob.eu>
PR fortran/41615
......
/* Verify that only one DW_AT_const_value is emitted for baz,
not for baz abstract DIE and again inside of
DW_TAG_inlined_subroutine. */
/* { dg-options "-O2 -g -dA" } */
/* { dg-do compile } */
/* { dg-final { scan-assembler-times " DW_AT_const_value" 1 } } */
struct A { const long i; const long j; };
static inline long
foo (void)
{
const struct A baz = { .i = 2, .j = 21 };
asm volatile ("" : : : "memory");
return baz.i * baz.j;
}
int
main ()
{
return foo () - 42;
}
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