------- Comment #15 from jakub at gcc dot gnu dot org 2007-12-03 22:38 ------- Subject: Bug 29749
Author: jakub Date: Mon Dec 3 22:38:28 2007 New Revision: 130589 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130589 Log: PR middle-end/29749 * fold-const.c (fold_binary) <case BIT_AND_EXPR>: Optimize (X << C1) & C2 into (X << C1) & (C2 | ((1 << C1) - 1)) and (X >> C1) & C2 into (X >> C1) & (C2 | ~((type) -1 >> C1)). (fold_binary) <case LSHIFT_EXPR, case RSHIFT_EXPR>: Optimize (X & C2) << C1 into (X << C1) & (C2 << C1) and (X & C2) >> C1 into (X >> C1) & (C2 >> C1) if that allows further optimizations. * gcc.dg/fold-rotate-1.c: New test. Added: trunk/gcc/testsuite/gcc.dg/fold-rotate-1.c Modified: trunk/gcc/ChangeLog trunk/gcc/fold-const.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29749