re PR tree-optimization/64454 (optimize (x%5)%5)
authorJakub Jelinek <jakub@redhat.com>
Mon, 12 Jan 2015 20:44:32 +0000 (21:44 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 12 Jan 2015 20:44:32 +0000 (21:44 +0100)
commitf51286f21f3b69878d9b5d55041089aba79c82a6
tree0217d8864283be08a04517b8666b0763b5234f11
parent01991953449246570f85f30b7b37e29a7e5b2cc1
re PR tree-optimization/64454 (optimize (x%5)%5)

PR tree-optimization/64454
* tree-vrp.c (simplify_div_or_mod_using_ranges): Optimize
op0 % op1 into op0 if op0 is in range [-op1 + 1, op1 - 1]
for signed or [0, op1 - 1] for unsigned modulo.
(simplify_stmt_using_ranges): Call simplify_div_or_mod_using_ranges
even if op1 does not satisfy integer_pow2p.

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

From-SVN: r219491
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr64454.c [new file with mode: 0644]
gcc/tree-vrp.c