aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-streamer-in.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-11-07 08:06:57 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-11-07 08:06:57 +0000
commit50258c4dcb13c1f3342e153d409416987e4ca100 (patch)
tree5cf5c487f8b6b82674dec468e380e17956791776 /gcc/tree-streamer-in.c
parent59193b1bdf0b0d707d3a21b006d3cb9d3fec7013 (diff)
downloadgcc-50258c4dcb13c1f3342e153d409416987e4ca100.zip
gcc-50258c4dcb13c1f3342e153d409416987e4ca100.tar.gz
gcc-50258c4dcb13c1f3342e153d409416987e4ca100.tar.bz2
re PR lto/87906 (ICE in tree check: expected block, have function_decl in block_ultimate_origin, at tree.c:12326 since r264734)
2018-11-07 Richard Biener <rguenther@suse.de> PR lto/87906 * tree-streamer-in.c (lto_input_ts_block_tree_pointers): Fixup BLOCK_ABSTRACT_ORIGIN to be the ultimate origin. * g++.dg/lto/pr87906_0.C: New testcase. * g++.dg/lto/pr87906_1.C: Likewise. From-SVN: r265861
Diffstat (limited to 'gcc/tree-streamer-in.c')
-rw-r--r--gcc/tree-streamer-in.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c
index f1e8244..a1e67d6 100644
--- a/gcc/tree-streamer-in.c
+++ b/gcc/tree-streamer-in.c
@@ -914,6 +914,12 @@ lto_input_ts_block_tree_pointers (struct lto_input_block *ib,
BLOCK_SUPERCONTEXT (expr) = stream_read_tree (ib, data_in);
BLOCK_ABSTRACT_ORIGIN (expr) = stream_read_tree (ib, data_in);
+ /* We may end up prevailing a decl with DECL_ORIGIN (t) != t here
+ which breaks the invariant that BLOCK_ABSTRACT_ORIGIN is the
+ ultimate origin. Fixup here.
+ ??? This should get fixed with moving to DIE references. */
+ if (DECL_P (BLOCK_ORIGIN (expr)))
+ BLOCK_ABSTRACT_ORIGIN (expr) = DECL_ORIGIN (BLOCK_ABSTRACT_ORIGIN (expr));
/* Do not stream BLOCK_NONLOCALIZED_VARS. We cannot handle debug information
for early inlined BLOCKs so drop it on the floor instead of ICEing in
dwarf2out.c. */