aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-09-03 14:29:00 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-09-03 14:29:00 +0000
commit339e6723c9c2c062933c17eec128407a0778d99d (patch)
tree2fd2df65b089c28553d9199311459088d891fe2c /gcc/tree-ssa-sccvn.c
parent7efe0dd0b43db1ac5070908290a3febfcfb73513 (diff)
downloadgcc-339e6723c9c2c062933c17eec128407a0778d99d.zip
gcc-339e6723c9c2c062933c17eec128407a0778d99d.tar.gz
gcc-339e6723c9c2c062933c17eec128407a0778d99d.tar.bz2
re PR tree-optimization/87200 (ICE in set_ssa_val_to, at tree-ssa-sccvn.c:3629)
2018-09-03 Richard Biener <rguenther@suse.de> PR tree-optimization/87200 * tree-ssa-sccvn.c (vn_nary_build_or_lookup_1): Valueize a simplify result. * gcc.dg/torture/pr87200.c: New testcase. From-SVN: r264062
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 26d093e..1f00335 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1759,8 +1759,13 @@ vn_nary_build_or_lookup_1 (gimple_match_op *res_op, bool insert)
gimple *new_stmt = NULL;
if (res
&& gimple_simplified_result_is_gimple_val (res_op))
- /* The expression is already available. */
- result = res_op->ops[0];
+ {
+ /* The expression is already available. */
+ result = res_op->ops[0];
+ /* Valueize it, simplification returns sth in AVAIL only. */
+ if (TREE_CODE (result) == SSA_NAME)
+ result = SSA_VAL (result);
+ }
else
{
tree val = vn_lookup_simplify_result (res_op);