aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-11-20 10:27:57 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-11-20 10:27:57 +0000
commitb34ac019f88b47629673274dd69009f292e03b79 (patch)
tree1e80322a082e177bab90e242c5da09b612e00aa6 /gcc/tree-ssa-sccvn.c
parent48c4096cda05491eaefd84654c5687de81a507a8 (diff)
downloadgcc-b34ac019f88b47629673274dd69009f292e03b79.zip
gcc-b34ac019f88b47629673274dd69009f292e03b79.tar.gz
gcc-b34ac019f88b47629673274dd69009f292e03b79.tar.bz2
re PR tree-optimization/88069 (ICE in check_loop_closed_ssa_def, at tree-ssa-loop-manip.c:709)
2018-11-20 Richard Biener <rguenther@suse.de> PR tree-optimization/88069 * tree-ssa-sccvn.c (visit_phi): Do not value-number to unvisited virtual PHI arguments. * gcc.dg/pr88069.c: New testcase. From-SVN: r266308
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 01bedf5..941752e 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -4194,12 +4194,19 @@ visit_phi (gimple *phi, bool *inserted, bool backedges_varying_p)
value from the backedge as that confuses the alias-walking code.
See gcc.dg/torture/pr87176.c. If the value is the same on a
non-backedge everything is OK though. */
- if (backedge_val
- && !seen_non_backedge
- && TREE_CODE (backedge_val) == SSA_NAME
- && sameval == backedge_val
- && (SSA_NAME_IS_VIRTUAL_OPERAND (backedge_val)
- || SSA_VAL (backedge_val) != backedge_val))
+ bool visited_p;
+ if ((backedge_val
+ && !seen_non_backedge
+ && TREE_CODE (backedge_val) == SSA_NAME
+ && sameval == backedge_val
+ && (SSA_NAME_IS_VIRTUAL_OPERAND (backedge_val)
+ || SSA_VAL (backedge_val) != backedge_val))
+ /* Do not value-number a virtual operand to sth not visited though
+ given that allows us to escape a region in alias walking. */
+ || (sameval
+ && TREE_CODE (sameval) == SSA_NAME
+ && SSA_NAME_IS_VIRTUAL_OPERAND (sameval)
+ && (SSA_VAL (sameval, &visited_p), !visited_p)))
/* Note this just drops to VARYING without inserting the PHI into
the hashes. */
result = PHI_RESULT (phi);