aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-09-21 12:12:33 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-09-21 12:12:33 +0000
commitc94f2d84e51b39f4f90c3cb3bf3c0d056080bc57 (patch)
treeeb449792b6cc53791f82ab644d4f35d2a588e077 /gcc/tree-vrp.c
parent817221cc87b78034dd750f6dc94ab336d7e802be (diff)
downloadgcc-c94f2d84e51b39f4f90c3cb3bf3c0d056080bc57.zip
gcc-c94f2d84e51b39f4f90c3cb3bf3c0d056080bc57.tar.gz
gcc-c94f2d84e51b39f4f90c3cb3bf3c0d056080bc57.tar.bz2
re PR tree-optimization/82276 (-O2: ICE: SSA corruption during RTL pass: expand; at tree-ssa-coalesce.c:1010)
2017-09-21 Richard Biener <rguenther@suse.de> PR tree-optimization/82276 PR tree-optimization/82244 * tree-vrp.c (build_assert_expr_for): Set SSA_NAME_OCCURS_IN_ABNORMAL_PHI if the variable we assert on has it set. (remove_range_assertions): Revert earlier change. * gcc.dg/torture/pr82276.c: New testcase. From-SVN: r253062
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 1d45851..aef20f4 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -4520,7 +4520,12 @@ build_assert_expr_for (tree cond, tree v)
operand of the ASSERT_EXPR. Create it so the new name and the old one
are registered in the replacement table so that we can fix the SSA web
after adding all the ASSERT_EXPRs. */
- create_new_def_for (v, assertion, NULL);
+ tree new_def = create_new_def_for (v, assertion, NULL);
+ /* Make sure we preserve abnormalness throughout an ASSERT_EXPR chain
+ given we have to be able to fully propagate those out to re-create
+ valid SSA when removing the asserts. */
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (v))
+ SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new_def) = 1;
return assertion;
}
@@ -7041,14 +7046,6 @@ remove_range_assertions (void)
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
SET_USE (use_p, var);
}
- /* But do not propagate constants as that is invalid. */
- else if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
- {
- gassign *ass = gimple_build_assign (lhs, var);
- gsi_replace (&si, ass, true);
- gsi_next (&si);
- continue;
- }
else
replace_uses_by (lhs, var);