From: Richard Biener Date: Wed, 29 Aug 2018 06:49:06 +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=95f0c81630e237f4f42ae6ae6eac73af3f96da5b;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-29 Richard Biener PR tree-optimization/87117 * tree-ssa-sccvn.c (eliminate_dom_walker::eliminate_stmt): Only re-value-number released SSA VDEFs. * gfortran.dg/pr87117.f90: New testcase. From-SVN: r263945 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 03a98c90ab2..2c0f5023a2d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-08-29 Richard Biener + + PR tree-optimization/87117 + * tree-ssa-sccvn.c (eliminate_dom_walker::eliminate_stmt): Only + re-value-number released SSA VDEFs. + 2018-08-29 Richard Biener PR tree-optimization/87126 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e6a9c8610cd..765d4a1e115 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-08-29 Richard Biener + + PR tree-optimization/87117 + * gfortran.dg/pr87117.f90: New testcase. + 2018-08-29 Richard Biener PR tree-optimization/87126 diff --git a/gcc/testsuite/gfortran.dg/pr87117.f90 b/gcc/testsuite/gfortran.dg/pr87117.f90 new file mode 100644 index 00000000000..afca653d08d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr87117.f90 @@ -0,0 +1,14 @@ +! { dg-do compile } +! { dg-options "-O" } +program p + real(4) :: a, b + integer(4) :: n, m + equivalence (a, n) + a = 1024.0 + m = 8 + a = 1024.0 + b = set_exponent(a, m) + n = 8 + a = f(a, n) + b = set_exponent(a, m) +end diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index aaac430bb46..04b3808feff 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -4989,8 +4989,14 @@ eliminate_dom_walker::eliminate_stmt (basic_block b, gimple_stmt_iterator *gsi) propagate_tree_value_into_stmt (gsi, sprime); stmt = gsi_stmt (*gsi); update_stmt (stmt); + /* In case the VDEF on the original stmt was released, value-number + it to the VUSE. This is to make vuse_ssa_val able to skip + released virtual operands. */ if (vdef != gimple_vdef (stmt)) - VN_INFO (vdef)->valnum = vuse; + { + gcc_assert (SSA_NAME_IN_FREE_LIST (vdef)); + VN_INFO (vdef)->valnum = vuse; + } /* If we removed EH side-effects from the statement, clean its EH information. */ @@ -5268,7 +5274,10 @@ eliminate_dom_walker::eliminate_stmt (basic_block b, gimple_stmt_iterator *gsi) fprintf (dump_file, " Removed AB side-effects.\n"); } update_stmt (stmt); - if (vdef != gimple_vdef (stmt)) + /* In case the VDEF on the original stmt was released, value-number + it to the VUSE. This is to make vuse_ssa_val able to skip + released virtual operands. */ + if (vdef && SSA_NAME_IN_FREE_LIST (vdef)) VN_INFO (vdef)->valnum = vuse; }