OSDN Git Service

2011-12-22 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Dec 2011 15:28:24 +0000 (15:28 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Dec 2011 15:28:24 +0000 (15:28 +0000)
PR lto/51650
* lto.c (uniquify_nodes): Register TYPE_DECLs with the
debuginfo machinery.

* g++.dg/lto/pr51650-1_0.C: New testcase.
* g++.dg/lto/pr51650-2_0.C: Likewise.

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

gcc/ChangeLog
gcc/lto/lto.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lto/pr51650-1_0.C [new file with mode: 0644]
gcc/testsuite/g++.dg/lto/pr51650-2_0.C [new file with mode: 0644]

index dfb2388..d60eb0e 100644 (file)
@@ -1,3 +1,9 @@
+2011-12-22  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/51650
+       * lto.c (uniquify_nodes): Register TYPE_DECLs with the
+       debuginfo machinery.
+
 2011-12-22  Bernd Schmidt  <bernds@codesourcery.com>
 
        * tree-pass.h (pass_reload): Declare.
index 9efd9c3..2ec6c44 100644 (file)
@@ -881,6 +881,9 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
        lto_register_var_decl_in_symtab (data_in, t);
       else if (TREE_CODE (t) == FUNCTION_DECL && !DECL_BUILT_IN (t))
        lto_register_function_decl_in_symtab (data_in, t);
+      else if (!flag_wpa
+              && TREE_CODE (t) == TYPE_DECL)
+       debug_hooks->type_decl (t, !DECL_FILE_SCOPE_P (t));
       else if (TYPE_P (t) && !TYPE_CANONICAL (t))
        TYPE_CANONICAL (t) = gimple_register_canonical_type (t);
     }
index 9e58adc..53fe4e8 100644 (file)
@@ -1,3 +1,9 @@
+2011-12-22  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/51650
+       * g++.dg/lto/pr51650-1_0.C: New testcase.
+       * g++.dg/lto/pr51650-2_0.C: Likewise.
+
 2011-12-21  Richard Earnshaw  <rearnsha@arm.com>
 
        PR target/51643
diff --git a/gcc/testsuite/g++.dg/lto/pr51650-1_0.C b/gcc/testsuite/g++.dg/lto/pr51650-1_0.C
new file mode 100644 (file)
index 0000000..4c9ef3c
--- /dev/null
@@ -0,0 +1,19 @@
+// { dg-lto-do link }
+// { dg-lto-options { { -flto -g } } }
+
+struct T;
+struct C 
+{
+    typedef ::T T;
+    static T *m ()
+      {
+       static T *d;
+       return d;
+      }
+};
+int
+fn ()
+{
+  C::m ();
+}
+int main() {}
diff --git a/gcc/testsuite/g++.dg/lto/pr51650-2_0.C b/gcc/testsuite/g++.dg/lto/pr51650-2_0.C
new file mode 100644 (file)
index 0000000..0979674
--- /dev/null
@@ -0,0 +1,9 @@
+// { dg-lto-do link }
+// { dg-lto-options { { -flto -g } } }
+
+typedef struct { } X;
+int main ()
+{
+  typedef X **P;
+  P g = 0;
+}