From: Richard Biener Date: Tue, 28 Aug 2018 10:15:54 +0000 (+0000) Subject: re PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e8bf292092c2d7e79f2e3d503ca1bdfe2642032;p=gcc.git re PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool) at gcc/gcc/tree-ssa-sccvn.c:5431 since r263875) 2018-08-28 Richard Biener PR tree-optimization/87117 * tree-ssa-sccvn.c (eliminate_dom_walker::eliminate_cleanup): Handle removed stmt without LHS (GIMPLE_NOP). From-SVN: r263912 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 694fdf24db3..a357b4ba448 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-08-28 Richard Biener + + PR tree-optimization/87117 + * tree-ssa-sccvn.c (eliminate_dom_walker::eliminate_cleanup): + Handle removed stmt without LHS (GIMPLE_NOP). + 2018-08-28 Richard Biener PR tree-optimization/87117 diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 381fc8dc195..9277de0cbdc 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -5425,31 +5425,28 @@ eliminate_dom_walker::eliminate_cleanup (bool region_p) do_release_defs = false; } } - else - { - tree lhs = gimple_get_lhs (stmt); - if (TREE_CODE (lhs) == SSA_NAME - && !has_zero_uses (lhs)) - { - if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, "Keeping eliminated stmt live " - "as copy because of out-of-region uses\n"); - tree sprime = eliminate_avail (gimple_bb (stmt), lhs); - gimple_stmt_iterator gsi = gsi_for_stmt (stmt); - if (is_gimple_assign (stmt)) - { - gimple_assign_set_rhs_from_tree (&gsi, sprime); - update_stmt (gsi_stmt (gsi)); - continue; - } - else - { - gimple *copy = gimple_build_assign (lhs, sprime); - gsi_insert_before (&gsi, copy, GSI_SAME_STMT); - do_release_defs = false; - } - } - } + else if (tree lhs = gimple_get_lhs (stmt)) + if (TREE_CODE (lhs) == SSA_NAME + && !has_zero_uses (lhs)) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, "Keeping eliminated stmt live " + "as copy because of out-of-region uses\n"); + tree sprime = eliminate_avail (gimple_bb (stmt), lhs); + gimple_stmt_iterator gsi = gsi_for_stmt (stmt); + if (is_gimple_assign (stmt)) + { + gimple_assign_set_rhs_from_tree (&gsi, sprime); + update_stmt (gsi_stmt (gsi)); + continue; + } + else + { + gimple *copy = gimple_build_assign (lhs, sprime); + gsi_insert_before (&gsi, copy, GSI_SAME_STMT); + do_release_defs = false; + } + } } if (dump_file && (dump_flags & TDF_DETAILS))