From 7f29dafe76b6530ec8c742487f7061492d7aaaf8 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 22 Nov 2018 09:54:14 +0000 Subject: [PATCH] re PR c++/87229 (ICE: tree code 'call_expr' is not supported in LTO streams) 2018-11-22 Richard Biener PR lto/87229 PR lto/88112 * lto-streamer-out.c (lto_is_streamable): Allow CALL_EXPRs which can appear in size expressions. * tree-streamer-in.c (unpack_ts_base_value_fields): Stream CALL_EXPR_BY_DESCRIPTOR. (streamer_read_tree_bitfields): Stream CALL_EXPR_IFN. * tree-streamer-out.c (pack_ts_base_value_fields): Stream CALL_EXPR_BY_DESCRIPTOR. (streamer_write_tree_bitfields): Stream CALL_EXPR_IFN. Revert PR lto/87229 * tree.c (free_lang_data_in_one_sizepos): Free non-gimple-val sizepos values. From-SVN: r266372 --- gcc/ChangeLog | 18 ++++++++++++++++++ gcc/lto-streamer-out.c | 1 - gcc/tree-streamer-in.c | 7 +++++++ gcc/tree-streamer-out.c | 7 +++++++ gcc/tree.c | 7 ------- 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f1f6b833950..b54ecfc1306 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,21 @@ +2018-11-22 Richard Biener + + PR lto/87229 + PR lto/88112 + * lto-streamer-out.c (lto_is_streamable): Allow CALL_EXPRs + which can appear in size expressions. + * tree-streamer-in.c (unpack_ts_base_value_fields): Stream + CALL_EXPR_BY_DESCRIPTOR. + (streamer_read_tree_bitfields): Stream CALL_EXPR_IFN. + * tree-streamer-out.c (pack_ts_base_value_fields): Stream + CALL_EXPR_BY_DESCRIPTOR. + (streamer_write_tree_bitfields): Stream CALL_EXPR_IFN. + + Revert + PR lto/87229 + * tree.c (free_lang_data_in_one_sizepos): Free non-gimple-val + sizepos values. + 2018-11-22 Richard Biener PR tree-optimization/88069 diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 2cb04029862..01193390cab 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -306,7 +306,6 @@ lto_is_streamable (tree expr) name version in lto_output_tree_ref (see output_ssa_names). */ return !is_lang_specific (expr) && code != SSA_NAME - && code != CALL_EXPR && code != LANG_TYPE && code != MODIFY_EXPR && code != INIT_EXPR diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c index 811d673bf2e..09ea70b1cba 100644 --- a/gcc/tree-streamer-in.c +++ b/gcc/tree-streamer-in.c @@ -158,6 +158,11 @@ unpack_ts_base_value_fields (struct bitpack_d *bp, tree expr) SSA_NAME_IS_DEFAULT_DEF (expr) = (unsigned) bp_unpack_value (bp, 1); bp_unpack_value (bp, 8); } + else if (TREE_CODE (expr) == CALL_EXPR) + { + CALL_EXPR_BY_DESCRIPTOR (expr) = (unsigned) bp_unpack_value (bp, 1); + bp_unpack_value (bp, 8); + } else bp_unpack_value (bp, 9); } @@ -521,6 +526,8 @@ streamer_read_tree_bitfields (struct lto_input_block *ib, MR_DEPENDENCE_BASE (expr) = (unsigned)bp_unpack_value (&bp, sizeof (short) * 8); } + else if (code == CALL_EXPR) + CALL_EXPR_IFN (expr) = bp_unpack_enum (&bp, internal_fn, IFN_LAST); } if (CODE_CONTAINS_STRUCT (code, TS_BLOCK)) diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index ac798a3e934..4e7c7429561 100644 --- a/gcc/tree-streamer-out.c +++ b/gcc/tree-streamer-out.c @@ -129,6 +129,11 @@ pack_ts_base_value_fields (struct bitpack_d *bp, tree expr) bp_pack_value (bp, SSA_NAME_IS_DEFAULT_DEF (expr), 1); bp_pack_value (bp, 0, 8); } + else if (TREE_CODE (expr) == CALL_EXPR) + { + bp_pack_value (bp, CALL_EXPR_BY_DESCRIPTOR (expr), 1); + bp_pack_value (bp, 0, 8); + } else bp_pack_value (bp, 0, 9); } @@ -457,6 +462,8 @@ streamer_write_tree_bitfields (struct output_block *ob, tree expr) if (MR_DEPENDENCE_CLIQUE (expr) != 0) bp_pack_value (&bp, MR_DEPENDENCE_BASE (expr), sizeof (short) * 8); } + else if (code == CALL_EXPR) + bp_pack_enum (&bp, internal_fn, IFN_LAST, CALL_EXPR_IFN (expr)); } if (CODE_CONTAINS_STRUCT (code, TS_BLOCK)) diff --git a/gcc/tree.c b/gcc/tree.c index 8264e9c7f14..39a92464414 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -5347,13 +5347,6 @@ free_lang_data_in_one_sizepos (tree *expr_p) tree expr = *expr_p; if (CONTAINS_PLACEHOLDER_P (expr)) *expr_p = build0 (PLACEHOLDER_EXPR, TREE_TYPE (expr)); - /* ??? We have to reset all non-GIMPLE sizepos because those eventually - refer to trees we cannot stream. See for example PR87229 which - shows an example with non-gimplified abstract origins in C++. - Note this should only happen for abstract copies so setting sizes - to NULL is OK (but we cannot easily assert this). */ - else if (expr && !is_gimple_val (expr)) - *expr_p = NULL_TREE; } -- 2.30.2