aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-12-05 21:51:07 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-12-05 21:51:07 +0100
commit17fe0fdbad5fd777bbfa62b44cd97becb5f72056 (patch)
treea496414e1a9ff51b4b3e64e44c33ea196bbb7056 /gcc/c-decl.c
parent156030d35f7c8edca2f7b801212a0f201b4369bc (diff)
downloadgcc-17fe0fdbad5fd777bbfa62b44cd97becb5f72056.zip
gcc-17fe0fdbad5fd777bbfa62b44cd97becb5f72056.tar.gz
gcc-17fe0fdbad5fd777bbfa62b44cd97becb5f72056.tar.bz2
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
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 4338fdf..1cdbf2f 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -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. */