diff options
author | Richard Biener <rguenther@suse.de> | 2018-08-29 06:49:06 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-08-29 06:49:06 +0000 |
commit | 95f0c81630e237f4f42ae6ae6eac73af3f96da5b (patch) | |
tree | 8311e5a2b411858126b369ec96fffd23b464885f /gcc/tree-ssa-sccvn.c | |
parent | e37f7da9c4b77aac0690c190206b286b9c82becd (diff) | |
download | gcc-95f0c81630e237f4f42ae6ae6eac73af3f96da5b.zip gcc-95f0c81630e237f4f42ae6ae6eac73af3f96da5b.tar.gz gcc-95f0c81630e237f4f42ae6ae6eac73af3f96da5b.tar.bz2 |
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 <rguenther@suse.de>
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
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index aaac430..04b3808 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; } |