summaryrefslogtreecommitdiff
path: root/gcc/tree-streamer-out.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-19 15:57:02 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-19 15:57:02 +0000
commit57bcbbf6d2c0c0d50ae6f59a638d9683f45870dd (patch)
tree16b996c2025405cb5a936807037ff9de2de2ece6 /gcc/tree-streamer-out.c
parent33185aa69c0b8ef353c75256989d91534958492a (diff)
downloadgcc-57bcbbf6d2c0c0d50ae6f59a638d9683f45870dd.tar.gz
2011-12-19 Richard Guenther <rguenther@suse.de>
PR lto/51573 * streamer-hooks.h (struct streamer_hooks): Add second ref_p parameter to write_tree. (stream_write_tree): Adjust. (stream_write_tree_shallow_non_ref): New define. * lto-streamer.h (lto_output_tree): Adjust. * lto-streamer-out.c (lto_output_tree): Likewise. * tree-streamer-out.c (streamer_write_chain): Only force the immediate tree to be streamed as non-reference. * gcc.dg/lto/20111207-2_0.c: Adjust. * g++.dg/lto/pr51573-1_0.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182487 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-streamer-out.c')
-rw-r--r--gcc/tree-streamer-out.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c
index 0e4d278fb5a..17b5be78c7c 100644
--- a/gcc/tree-streamer-out.c
+++ b/gcc/tree-streamer-out.c
@@ -410,9 +410,11 @@ streamer_write_chain (struct output_block *ob, tree t, bool ref_p)
to the global decls section as we do not want to have them
enter decl merging. This is, of course, only for the call
for streaming BLOCK_VARS, but other callers are safe. */
- stream_write_tree (ob, t,
- ref_p && !(VAR_OR_FUNCTION_DECL_P (t)
- && DECL_EXTERNAL (t)));
+ if (VAR_OR_FUNCTION_DECL_P (t)
+ && DECL_EXTERNAL (t))
+ stream_write_tree_shallow_non_ref (ob, t, ref_p);
+ else
+ stream_write_tree (ob, t, ref_p);
TREE_CHAIN (t) = saved_chain;
t = TREE_CHAIN (t);