aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRafael Avila de Espindola <espindola@google.com>2010-01-04 15:25:11 +0000
committerRafael Espindola <espindola@gcc.gnu.org>2010-01-04 15:25:11 +0000
commit785ca51445a9b037c55ad5739eeafce9b49166e2 (patch)
tree1e48210da1fe4f834fec95226553d5bc2de61845 /gcc
parent22554cf9376fc1253adb75a290c4a38f82562b5c (diff)
downloadgcc-785ca51445a9b037c55ad5739eeafce9b49166e2.zip
gcc-785ca51445a9b037c55ad5739eeafce9b49166e2.tar.gz
gcc-785ca51445a9b037c55ad5739eeafce9b49166e2.tar.bz2
20100104_0.c: New.
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/lto-streamer-out.c7
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100104_0.c8
4 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 11adcd0..39c9b61 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 6d13373..b27bbdd 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 44f692c..30b80af 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..c17e768
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20100104_0.c
@@ -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;