diff options
author | Rafael Avila de Espindola <espindola@google.com> | 2010-01-11 02:28:49 +0000 |
---|---|---|
committer | Rafael Espindola <espindola@gcc.gnu.org> | 2010-01-11 02:28:49 +0000 |
commit | 06bfe1d0e2c40805cc6fa1d8d39f59c4d529965f (patch) | |
tree | 8ce29cad9a5651018f71714cf70674e0e440c9e5 /gcc/lto-streamer-out.c | |
parent | bd2638ac9f3a937b9084fd130d7a3002dae4a201 (diff) | |
download | gcc-06bfe1d0e2c40805cc6fa1d8d39f59c4d529965f.zip gcc-06bfe1d0e2c40805cc6fa1d8d39f59c4d529965f.tar.gz gcc-06bfe1d0e2c40805cc6fa1d8d39f59c4d529965f.tar.bz2 |
20100108_0.c: New.
2010-01-10 Rafael Avila de Espindola <espindola@google.com>
* gcc.dg/lto/20100108_0.c: New.
2010-01-10 Rafael Avila de Espindola <espindola@google.com>
* lto-streamer-out.c (output_unreferenced_globals): Output static
variables.
From-SVN: r155800
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r-- | gcc/lto-streamer-out.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index b27bbdd..fe43dce 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -1973,12 +1973,15 @@ output_unreferenced_globals (cgraph_node_set set) { tree var = vnode->decl; - if (TREE_CODE (var) == VAR_DECL && TREE_PUBLIC (var)) + if (TREE_CODE (var) == VAR_DECL) { - /* Outputting just the reference will not output the object itself - or references it might have.*/ + /* Output the object in order to output references used in the + initialization. */ lto_output_tree (ob, var, true); - lto_output_tree_ref (ob, var); + + /* If it is public we also need a reference to the object itself. */ + if (TREE_PUBLIC (var)) + lto_output_tree_ref (ob, var); } } |