aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorBin Cheng <bin.cheng@arm.com>2016-04-21 11:28:58 +0000
committerBin Cheng <amker@gcc.gnu.org>2016-04-21 11:28:58 +0000
commit2359e571cd71026167931216e730129d53244dd1 (patch)
tree93769dac35b40a1151671d0c8e5afcda93f8bd2a /gcc/tree-ssa-loop-niter.c
parentce0e66ffb22832d1668dd9d92ad0ca128fbd07c3 (diff)
downloadgcc-2359e571cd71026167931216e730129d53244dd1.zip
gcc-2359e571cd71026167931216e730129d53244dd1.tar.gz
gcc-2359e571cd71026167931216e730129d53244dd1.tar.bz2
re PR tree-optimization/70715 (SCEV failed to prove no-overflow-ness information unsigned loop IV)
PR tree-optimization/70715 * tree-ssa-loop-niter.c (loop_exits_before_overflow): Check equality after expanding BASE using expand_simple_operations. gcc/testsuite/ChangeLog PR tree-optimization/70715 * gcc.dg/tree-ssa/scev-13.c: New test. From-SVN: r235333
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 81689fc..c61083e 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -4141,7 +4141,11 @@ loop_exits_before_overflow (tree base, tree step,
continue;
/* Done proving if this is a no-overflow control IV. */
- if (operand_equal_p (base, civ->base, 0))
+ if (operand_equal_p (base, civ->base, 0)
+ /* Control IV is recorded after expanding simple operations,
+ Here we compare it against expanded base too. */
+ || operand_equal_p (expand_simple_operations (base),
+ civ->base, 0))
return true;
/* If this is a before stepping control IV, in other words, we have