This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/31261] Missed tree optimizations: (8 - (x & 7)) & 7
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 30 Sep 2010 19:21:51 +0000
- Subject: [Bug tree-optimization/31261] Missed tree optimizations: (8 - (x & 7)) & 7
- Auto-submitted: auto-generated
- References: <bug-31261-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31261
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-09-30 19:21:44 UTC ---
Author: jakub
Date: Thu Sep 30 19:21:34 2010
New Revision: 164761
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164761
Log:
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.
Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr31261.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog