re PR tree-optimization/77975 (Missed optimization for some small constants)
authorJakub Jelinek <jakub@gcc.gnu.org>
Fri, 10 Mar 2017 07:53:57 +0000 (08:53 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 10 Mar 2017 07:53:57 +0000 (08:53 +0100)
commit5558f089e39350824d7bc3d5467f72e1e90b2fae
tree048b43e76b3678907b012f3965fd13785fdd8779
parente837554452518ca73af4ec64b0468991fdff4f7d
re PR tree-optimization/77975 (Missed optimization for some small constants)

PR tree-optimization/77975
* tree-ssa-loop-niter.c (get_base_for): Allow phi argument from latch
edge to be constant.
(get_val_for): For constant x return it.  Formatting fix.
(loop_niter_by_eval): Avoid pointless looping if the next iteration
would use the same bases as the current one.

* gcc.dg/pr77975.c: New test.

From-SVN: r246021
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr77975.c [new file with mode: 0644]
gcc/tree-ssa-loop-niter.c