re PR middle-end/24427 (missing optimization opportunity with binary operators)
authorRoger Sayle <roger@eyesopen.com>
Mon, 13 Feb 2006 18:33:32 +0000 (18:33 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Mon, 13 Feb 2006 18:33:32 +0000 (18:33 +0000)
commit840992bdc20effc919b96522ab4f82fd96087939
treed38a31a2f50f89e4589d53b8f378f0319c82ce34
parent4c553323a6f4d90e48002ea23b7f779c106ad620
re PR middle-end/24427 (missing optimization opportunity with binary operators)

PR middle-end/24427
* fold-const.c (fold_binary) <BIT_IOR_EXPR>: Transform (X&C1)|C2
into (X,C2) if C1 is a subset of the bits of C2.  Transform
(X&C1)|C2 into X|C2 if C1|C2 == ~0.  Canonicalize (X&C1)|C2 as
(X&(C1&~C2))|C2.
<BIT_AND_EXPR>: Canonicalize (X|C1)&C2 as (X&C2)|(C1&C2).

* gcc.dg/tree-ssa/andor-1.c: New test case.

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