OSDN Git Service

Fix for PR debug/43325
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Apr 2010 18:54:30 +0000 (18:54 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:16:12 +0000 (14:16 +0900)
gcc/ChangeLog:
PR debug/43325
* dwarf2out.c (gen_variable_die): Allow debug info for variable
re-declaration when it happens in a function.

gcc/testsuite/ChangeLog:
PR debug/43325
* c-c++-common/dwarf2/redeclaration-1.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157928 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/dwarf2/redeclaration-1.C [new file with mode: 0644]

index ca3756d..3b33160 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-01  Dodji Seketeli  <dodji@redhat.com>
+
+       PR debug/43325
+       * dwarf2out.c (gen_variable_die): Allow debug info for variable
+       re-declaration when it happens in a function.
+
 2010-04-01  Aldy Hernandez  <aldyh@redhat.com>
 
        * cgraph.c (cgraph_add_function_insertion_hook): Update comment.
index c37f629..8a18fcb 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-01  Dodji Seketeli  <dodji@redhat.com>
+
+       PR debug/43325
+       * c-c++-common/dwarf2/redeclaration-1.C: New test.
+
 2010-04-01  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/cpp0x/initlist12.C: Adjust expected errors.
diff --git a/gcc/testsuite/c-c++-common/dwarf2/redeclaration-1.C b/gcc/testsuite/c-c++-common/dwarf2/redeclaration-1.C
new file mode 100644 (file)
index 0000000..8aaff8e
--- /dev/null
@@ -0,0 +1,18 @@
+// Origin: PR debug/43325
+// { dg-options "-g -dA" }
+// { dg-do compile }
+
+// { dg-final { scan-assembler-times "\[^\n\r\]*\\(DIE \[^\n\r\]*DW_TAG_lexical_block\\)\[\n\r\]{1,2}\[^\n\r\]*DW_AT_low_pc\[\n\r\]{1,2}\[^\n\r\]*DW_AT_high_pc\[\n\r\]{1,2}\[^\n\r\]*\\(DIE \[^\n\r\]*DW_TAG_variable\\)\[\n\r\]{1,2}\[^\n\r\]*DW_AT_name" 2 } }
+
+namespace S
+{
+  int
+  f()
+  {
+    int i = 42;
+    {
+      extern int i;
+      return i;
+    }
+  }
+}