Commit 17fe0fdb by Jakub Jelinek Committed by Jakub Jelinek

re PR debug/51410 (duplicate variable DIE)

	PR debug/51410
	* c-decl.c (pop_scope): Don't add DECL_EXTERNAL decls
	for debug info if scope is file_scope.

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

From-SVN: r182027
parent 156030d3
2011-12-05 Jakub Jelinek <jakub@redhat.com>
PR debug/51410
* c-decl.c (pop_scope): Don't add DECL_EXTERNAL decls
for debug info if scope is file_scope.
PR c/51339
* c-decl.c (c_finish_incomplete_decl, finish_decl): Call
relayout_decl instead of layout_decl.
......@@ -1196,7 +1196,7 @@ pop_scope (void)
DECL_CHAIN (p) = BLOCK_VARS (block);
BLOCK_VARS (block) = p;
}
else if (VAR_OR_FUNCTION_DECL_P (p))
else if (VAR_OR_FUNCTION_DECL_P (p) && scope != file_scope)
{
/* For block local externs add a special
DECL_EXTERNAL decl for debug info generation. */
......
2011-12-05 Jakub Jelinek <jakub@redhat.com>
PR debug/51410
* gcc.dg/debug/dwarf2/pr51410.c: New test.
PR c/51339
* gcc.dg/gomp/pr51339.c: New test.
......
/* PR debug/51410 */
/* { dg-do compile } */
/* { dg-options "-O0 -gdwarf-2 -dA -fno-merge-debug-strings" } */
int x;
int
foo (void)
{
return x;
}
/* { dg-final { scan-assembler-times "\\(DIE\[^\\r\\n\]*DW_TAG_variable\\)" 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