From 0864675cc5f34e68e20fb5d7a9d38e92d7561dbc Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 14 Dec 2018 00:35:10 +0100 Subject: [PATCH] re PR tree-optimization/88444 (ICE: tree check: expected ssa_name, have integer_cst in live_on_edge, at tree-vrp.c:468; or ICE: tree check: expected ssa_name, have integer_cst in get_value_range, at vr-values.c:84) PR tree-optimization/88444 * tree-inline.c (fold_marked_statements): Iterate up to last_basic_block_for_fn rather than n_basic_blocks_for_fn. * gcc.dg/tree-ssa/pr88444.c: New test. From-SVN: r267113 --- gcc/ChangeLog | 4 ++++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.dg/tree-ssa/pr88444.c | 6 ++++++ gcc/tree-inline.c | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr88444.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3f1eeb7ba41..7b4c219e761 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2018-12-13 Jakub Jelinek + PR tree-optimization/88444 + * tree-inline.c (fold_marked_statements): Iterate up to + last_basic_block_for_fn rather than n_basic_blocks_for_fn. + PR rtl-optimization/88470 * cfgcleanup.c (outgoing_edges_match): If the function is shrink-wrapped and bb1 ends with a JUMP_INSN with a single fake diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b0dae2b68d8..3ce50c8a05c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-12-13 Jakub Jelinek + PR tree-optimization/88444 + * gcc.dg/tree-ssa/pr88444.c: New test. + PR rtl-optimization/88470 * gcc.target/i386/pr88470.c: New test. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr88444.c b/gcc/testsuite/gcc.dg/tree-ssa/pr88444.c new file mode 100644 index 00000000000..31ed316dc5b --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr88444.c @@ -0,0 +1,6 @@ +/* PR tree-optimization/88444 */ +/* { dg-do compile } */ +/* { dg-options "-O1 -finline-functions -finline-small-functions -fdump-tree-fixup_cfg3" } */ +/* { dg-final { scan-tree-dump-not " = \\(long int\\) 0;" "fixup_cfg3" } } */ + +#include "../pr88444.c" diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 52f0310021e..8c4c82e54e8 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4906,7 +4906,7 @@ gimple_expand_calls_inline (basic_block bb, copy_body_data *id) static void fold_marked_statements (int first, hash_set *statements) { - for (; first < n_basic_blocks_for_fn (cfun); first++) + for (; first < last_basic_block_for_fn (cfun); first++) if (BASIC_BLOCK_FOR_FN (cfun, first)) { gimple_stmt_iterator gsi; -- 2.30.2