aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-09-05 10:33:41 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-09-05 10:33:41 +0000
commit85004cb2dcc43010001d6231cf6aca6eb769d2c3 (patch)
treebf68136adfd09a717d631cb80451a0d3d258928a /gcc/tree-ssa-sccvn.c
parenta79878585a1c5e32bafbc6d1e73f91fd6e4293bf (diff)
downloadgcc-85004cb2dcc43010001d6231cf6aca6eb769d2c3.zip
gcc-85004cb2dcc43010001d6231cf6aca6eb769d2c3.tar.gz
gcc-85004cb2dcc43010001d6231cf6aca6eb769d2c3.tar.bz2
re PR tree-optimization/87217 (ICE in in check_loop_closed_ssa_def, at tree-ssa-loop-manip.c:709 when compiling SPEC2000 starting with r264069)
2018-09-05 Richard Biener <rguenther@suse.de> PR tree-optimization/87217 * tree-ssa-sccvn.c (vuse_valueize): New. (vn_reference_lookup_pieces): Use it. (vn_reference_lookup): Likewise. * gfortran.dg/pr87217.f: New testcase. From-SVN: r264121
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 1e4bfe5..105605a 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -493,6 +493,25 @@ vuse_ssa_val (tree x)
return x;
}
+/* Similar to the above but used as callback for walk_non_aliases_vuses
+ and thus should stop at unvisited VUSE to not walk across region
+ boundaries. */
+
+static tree
+vuse_valueize (tree vuse)
+{
+ do
+ {
+ bool visited;
+ vuse = SSA_VAL (vuse, &visited);
+ if (!visited)
+ return NULL_TREE;
+ gcc_assert (vuse != VN_TOP);
+ }
+ while (SSA_NAME_IN_FREE_LIST (vuse));
+ return vuse;
+}
+
/* Return the vn_kind the expression computed by the stmt should be
associated with. */
@@ -2573,7 +2592,7 @@ vn_reference_lookup_pieces (tree vuse, alias_set_type set, tree type,
(vn_reference_t)walk_non_aliased_vuses (&r, vr1.vuse,
vn_reference_lookup_2,
vn_reference_lookup_3,
- vuse_ssa_val, &vr1);
+ vuse_valueize, &vr1);
gcc_checking_assert (vr1.operands == shared_lookup_references);
}
@@ -2629,7 +2648,7 @@ vn_reference_lookup (tree op, tree vuse, vn_lookup_kind kind,
(vn_reference_t)walk_non_aliased_vuses (&r, vr1.vuse,
vn_reference_lookup_2,
vn_reference_lookup_3,
- vuse_ssa_val, &vr1);
+ vuse_valueize, &vr1);
gcc_checking_assert (vr1.operands == shared_lookup_references);
if (wvnresult)
{