summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-20 10:22:33 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-20 10:22:33 +0000
commitd51283e36424d4c473746cb6bfbdcbfc38b83571 (patch)
treea318aa77a02219a41545ed33d2b1c50c54ba881a /gcc/tree-ssa-loop-niter.c
parent7403e67b5732dd2f73614cc53c991336127a3930 (diff)
downloadgcc-d51283e36424d4c473746cb6bfbdcbfc38b83571.tar.gz
2013-06-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/57584 * tree-ssa-loop-niter.c (expand_simple_operations): Avoid including SSA names into the expanded expression that take part in abnormal coalescing. * gcc.dg/torture/pr57584.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200237 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index f5629306e4b..9d6f9efb089 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -1514,6 +1514,13 @@ expand_simple_operations (tree expr)
if (gimple_code (stmt) != GIMPLE_ASSIGN)
return expr;
+ /* Avoid expanding to expressions that contain SSA names that need
+ to take part in abnormal coalescing. */
+ ssa_op_iter iter;
+ FOR_EACH_SSA_TREE_OPERAND (e, stmt, iter, SSA_OP_USE)
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (e))
+ return expr;
+
e = gimple_assign_rhs1 (stmt);
code = gimple_assign_rhs_code (stmt);
if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)