aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-streamer-out.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-12-19 15:57:02 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-12-19 15:57:02 +0000
commit7e54c6084da692073648d73aaa36dc06f562abc7 (patch)
tree16b996c2025405cb5a936807037ff9de2de2ece6 /gcc/tree-streamer-out.c
parent23a3541f271216b1a518ecb6f713500b76949172 (diff)
downloadgcc-7e54c6084da692073648d73aaa36dc06f562abc7.zip
gcc-7e54c6084da692073648d73aaa36dc06f562abc7.tar.gz
gcc-7e54c6084da692073648d73aaa36dc06f562abc7.tar.bz2
re PR lto/51573 (ICE (segfault) in lto_varpool_encoder_encode_initializer_p)
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. From-SVN: r182487
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 0e4d278..17b5be7 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);