]> git.ipfire.org Git - thirdparty/gcc.git/commit
fold-const.c (fold_binary): Fold (X & Y) ^ Y as the equivalent ~X & Y, and the symmet...
authorRoger Sayle <roger@eyesopen.com>
Tue, 28 Mar 2006 17:55:26 +0000 (17:55 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Tue, 28 Mar 2006 17:55:26 +0000 (17:55 +0000)
commitdd2c62dcb685f9de4d53cd8c6e656e358754589a
tree1b476f274da069b822455449eb6034e17e14926c
parent3cc82eea2bfea5681e8374a85794102b68bdd4be
fold-const.c (fold_binary): Fold (X & Y) ^ Y as the equivalent ~X & Y, and the symmetry related transformations.

* fold-const.c (fold_binary) <BIT_XOR_EXPR>: Fold (X & Y) ^ Y as
the equivalent ~X & Y, and the symmetry related transformations.
(fold_binary) <BIT_AND_EXPR>: Similarly, fold (X ^ Y) & Y as
~X & Y, and symmetry related transforms.

* gcc.dg/fold-andxor-1.c: New test case.
* gcc.dg/fold-xorand-1.c: Likewise.

From-SVN: r112459
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/fold-andxor-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/fold-xorand-1.c [new file with mode: 0644]