aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
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);