diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-02-03 06:01:40 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-02-03 06:01:40 +0000 |
commit | 4f2bfa26e4630b905c43dd852395b2d5047d388c (patch) | |
tree | 24e9cf0f5046d167fed3c35adba388143c7ffc46 /gcc/tree-ssa-loop-niter.c | |
parent | a501acdaaacf5f3b1fa97242ff4f38cc1d87553d (diff) | |
download | gcc-4f2bfa26e4630b905c43dd852395b2d5047d388c.tar.gz |
gcc/ChangeLog:
PR tree-optimization/45122
* tree-ssa-loop-niter.c (number_of_iterations_exit): Don't make
unsafe assumptions when there's more than one loop exit.
gcc/testsuite/ChangeLog:
PR tree-optimization/45122
* gcc.dg/tree-ssa/pr45122.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169781 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index ee85f6fe006..c14e13c7248 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -1890,7 +1890,7 @@ number_of_iterations_exit (struct loop *loop, edge exit, /* With -funsafe-loop-optimizations we assume that nothing bad can happen. But if we can prove that there is overflow or some other source of weird behavior, ignore the loop even with -funsafe-loop-optimizations. */ - if (integer_zerop (niter->assumptions)) + if (integer_zerop (niter->assumptions) || !single_exit (loop)) return false; if (flag_unsafe_loop_optimizations) |