aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-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/lto-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/lto-streamer-out.c')
-rw-r--r--gcc/lto-streamer-out.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 6c1169a..4b3be3b 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -370,11 +370,12 @@ lto_write_tree (struct output_block *ob, tree expr, bool ref_p)
/* Emit the physical representation of tree node EXPR to output block
- OB. If REF_P is true, the leaves of EXPR are emitted as references
- via lto_output_tree_ref. */
+ OB. If THIS_REF_P is true, the leaves of EXPR are emitted as references
+ via lto_output_tree_ref. REF_P is used for streaming siblings of EXPR. */
void
-lto_output_tree (struct output_block *ob, tree expr, bool ref_p)
+lto_output_tree (struct output_block *ob, tree expr,
+ bool ref_p, bool this_ref_p)
{
unsigned ix;
bool existed_p;
@@ -385,7 +386,7 @@ lto_output_tree (struct output_block *ob, tree expr, bool ref_p)
return;
}
- if (ref_p && tree_is_indexable (expr))
+ if (this_ref_p && tree_is_indexable (expr))
{
lto_output_tree_ref (ob, expr);
return;