Commit 591a8495 by Jakub Jelinek Committed by Jakub Jelinek

c-decl.c (finish_struct): Adjust DECL_SOURCE_LOCATION of TYPE_STUB_DECL.

	* c-decl.c (finish_struct): Adjust DECL_SOURCE_LOCATION of
	TYPE_STUB_DECL.

	* gcc.dg/debug/dwarf2/struct-loc1.c: New test.

From-SVN: r151816
parent 417b3023
2009-09-17 Jakub Jelinek <jakub@redhat.com>
* c-decl.c (finish_struct): Adjust DECL_SOURCE_LOCATION of
TYPE_STUB_DECL.
2009-09-17 Alexandre Oliva <aoliva@redhat.com>
* dwarf2out.c (loc_descriptor): Emit DW_OP_stack_value and
......
......@@ -6859,6 +6859,11 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
}
C_TYPE_INCOMPLETE_VARS (TYPE_MAIN_VARIANT (t)) = 0;
/* Update type location to the one of the definition, instead of e.g.
a forward declaration. */
if (TYPE_STUB_DECL (t))
DECL_SOURCE_LOCATION (TYPE_STUB_DECL (t)) = loc;
/* Finish debugging output for this type. */
rest_of_type_compilation (t, toplevel);
......
2009-09-17 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/debug/dwarf2/struct-loc1.c: New test.
2009-09-17 Janis Johnson <janis187@us.ibm.com>
PR c/41049
......
/* { dg-do compile } */
/* { dg-options "-g -O0 -dA -fno-merge-debug-strings" } */
struct foo;
struct foo *obj;
struct foo
{
int x;
};
int
main ()
{
return 0;
}
/* { dg-final { scan-assembler "DW_TAG_structure_type\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"foo\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?6\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
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