summaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-out.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r--gcc/lto-streamer-out.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 6d1337378bb..b27bbdd0704 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);