]> gcc.gnu.org Git - gcc.git/commitdiff
20100104_0.c: New.
authorRafael Avila de Espindola <espindola@google.com>
Mon, 4 Jan 2010 15:25:11 +0000 (15:25 +0000)
committerRafael Espindola <espindola@gcc.gnu.org>
Mon, 4 Jan 2010 15:25:11 +0000 (15:25 +0000)
2010-01-04  Rafael Avila de Espindola  <espindola@google.com>

* gcc.dg/lto/20100104_0.c: New.

2010-01-04  Rafael Avila de Espindola  <espindola@google.com>

* lto-streamer-out.c (output_unreferenced_globals): Output the full
tree of an unreferenced global var.

From-SVN: r155619

gcc/ChangeLog
gcc/lto-streamer-out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/20100104_0.c [new file with mode: 0644]

index 11adcd05ec8ad6fa8fb66c6b8a7b26f6c0426530..39c9b614f6fad05ae06db56c3d2195a799eb8065 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-04  Rafael Avila de Espindola  <espindola@google.com>
+
+       * lto-streamer-out.c (output_unreferenced_globals): Output the full
+       tree of an unreferenced global var.
+
 2010-01-04  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/42542
index 6d1337378bb44a1f09f5249e7ac085bd466af278..b27bbdd07041808fa2977f87c37b813fa52067b3 100644 (file)
@@ -1974,7 +1974,12 @@ output_unreferenced_globals (cgraph_node_set set)
       tree var = vnode->decl;
 
       if (TREE_CODE (var) == VAR_DECL && TREE_PUBLIC (var))
-       lto_output_tree_ref (ob, var);
+        {
+          /* Outputting just the reference will not output the object itself
+             or references it might have.*/
+          lto_output_tree (ob, var, true);
+          lto_output_tree_ref (ob, var);
+        }
     }
 
   output_zero (ob);
index 44f692cc74d02ee8d5eab0c13c1cffb09c9ddee7..30b80afd82e37339a4b4b0b70ab0fb3dcad8f052 100644 (file)
@@ -1,3 +1,7 @@
+2010-01-04  Rafael Avila de Espindola  <espindola@google.com>
+
+       * gcc.dg/lto/20100104_0.c: New.
+
 2010-01-04  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/42542
diff --git a/gcc/testsuite/gcc.dg/lto/20100104_0.c b/gcc/testsuite/gcc.dg/lto/20100104_0.c
new file mode 100644 (file)
index 0000000..c17e768
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-lto-do assemble } */
+/* The problem with this testcase is that we were missing an undefined
+   reference to c_common_attribute_table. This can be tested with
+   GNUTARGET=plugin nm --plugin liblto_plugin.so 20100104_0.o
+   but we don't have support in the testsuite for doing it. */
+
+extern int c_common_attribute_table[];
+void *foobar = c_common_attribute_table;
This page took 0.081444 seconds and 5 git commands to generate.