re PR tree-optimization/31261 (Missed tree optimizations: (8 - (x & 7)) & 7)
authorJakub Jelinek <jakub@redhat.com>
Thu, 30 Sep 2010 19:21:34 +0000 (21:21 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 30 Sep 2010 19:21:34 +0000 (21:21 +0200)
commit140d4effd556b7da4a322f8d34c2dde6758d09e7
treeb8f4be9858411bbb0b971675fd0bd1a833a0e271
parente1826acc350a2fcf021b6fa20f515e0bd23b0eb2
re PR tree-optimization/31261 (Missed tree optimizations: (8 - (x & 7)) & 7)

PR tree-optimization/31261
* fold-const.c (fold_binary): Optimize ((A & N) + B) & M
for constants M and N, M == (1LL << cst) - 1 && (N & M) == M.

* gcc.dg/tree-ssa/pr31261.c: New test.

From-SVN: r164761
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr31261.c [new file with mode: 0644]