OSDN Git Service

Fix PR debug/43628
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Apr 2010 09:59:04 +0000 (09:59 +0000)
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Apr 2010 09:59:04 +0000 (09:59 +0000)
gcc/ChangeLog:
PR debug/43628
* dwarf2out.c (modified_type_die): Ignore artificial typedefs.

gcc/testsuite/ChangeLog:
PR debug/43628
* g++.dg/debug/dwarf2/typedef2.C: New test.

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

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/debug/dwarf2/typedef2.C [new file with mode: 0644]

index a7773a1..34b0a26 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-07  Dodji Seketeli  <dodji@redhat.com>
+
+       PR debug/43628
+       * dwarf2out.c (modified_type_die): Ignore artificial typedefs.
+
 2010-04-06  Kai Tietz  <kai.tietz@onevision.com>
 
        * config/i386/i386.c (ix86_handle_cconv_attribute): Ignore
index 82b0d49..5fd0ec6 100644 (file)
@@ -12146,7 +12146,8 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
   name = qualified_type ? TYPE_NAME (qualified_type) : NULL;
 
   /* Handle C typedef types.  */
-  if (name && TREE_CODE (name) == TYPE_DECL && DECL_ORIGINAL_TYPE (name))
+  if (name && TREE_CODE (name) == TYPE_DECL && DECL_ORIGINAL_TYPE (name)
+      && !DECL_ARTIFICIAL (name))
     {
       tree dtype = TREE_TYPE (name);
 
index 4aa4800..ce0a439 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-07  Dodji Seketeli  <dodji@redhat.com>
+
+       PR debug/43628
+       * g++.dg/debug/dwarf2/typedef2.C: New test.
+
 2010-04-06  Dodji Seketeli  <dodji@redhat.com>
 
        * g++.dg/debug/dwarf2/redeclaration-1.C: Moved from 
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/typedef2.C b/gcc/testsuite/g++.dg/debug/dwarf2/typedef2.C
new file mode 100644 (file)
index 0000000..5bf0499
--- /dev/null
@@ -0,0 +1,11 @@
+// Origin: PR debug/43628
+// { dg-options "-g -dA" }
+// { dg-do compile }
+
+// { dg-final { scan-assembler-times "\[^\n\r\]*\\(DIE\[^\n\r\]*DW_TAG_formal_parameter\\)\[\n\r\]{1,2}\[^\n\r\]*DW_AT_type\[\n\r\]{1,2}" 1 } }
+class C
+{
+  public:
+  typedef void (*t) (C);
+};
+C::t f;