aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-01-27 12:24:54 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-01-27 12:24:54 +0000
commit38f50ab65ae67aa9896ca7a18a80d77b4648a0b0 (patch)
tree52e855ee28a86a77ff9ed38d8d896098328986c8 /gcc/tree-vrp.c
parentc04f41398e6ec418907dc8e7f4a761345ac23a74 (diff)
downloadgcc-38f50ab65ae67aa9896ca7a18a80d77b4648a0b0.zip
gcc-38f50ab65ae67aa9896ca7a18a80d77b4648a0b0.tar.gz
gcc-38f50ab65ae67aa9896ca7a18a80d77b4648a0b0.tar.bz2
re PR tree-optimization/79244 (ice in replace_uses_by, at tree-cfg.c:1866)
2017-01-27 Richard Biener <rguenther@suse.de> PR tree-optimization/79244 * tree-vrp.c (remove_range_assertions): Forcefully propagate out SSA names even if abnormal. * gcc.dg/torture/pr79244.c: New testcase. From-SVN: r244973
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index d7d7a0d..e023244 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -6974,8 +6974,20 @@ remove_range_assertions (void)
}
}
- /* Propagate the RHS into every use of the LHS. */
- replace_uses_by (lhs, var);
+ /* Propagate the RHS into every use of the LHS. For SSA names
+ also propagate abnormals as it merely restores the original
+ IL in this case (an replace_uses_by would assert). */
+ if (TREE_CODE (var) == SSA_NAME)
+ {
+ imm_use_iterator iter;
+ use_operand_p use_p;
+ gimple *use_stmt;
+ FOR_EACH_IMM_USE_STMT (use_stmt, iter, lhs)
+ FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
+ SET_USE (use_p, var);
+ }
+ else
+ replace_uses_by (lhs, var);
/* And finally, remove the copy, it is not needed. */
gsi_remove (&si, true);