This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] convert (a | b)^b to a & (~b)
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Andrew Pinski <apinski at apple dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 10 Mar 2003 09:54:01 -0800
- Subject: Re: [PATCH] convert (a | b)^b to a & (~b)
- References: <95A0CBE4-531F-11D7-85D1-00039372607E@apple.com>
Andrew Pinski <apinski at apple dot com> writes:
> This patch converts (a | b)^b to a & (~b).
> Since they are equivalent.
>
> ChangeLog:
> 2003-03-10 Andrew Pinski <apinski at apple dot com>
>
> * combine.c (simplify_logical): [XOR] Convert
> (a | b)^b to a & (~b).
OK.
You might consider doing this in fold-const.c and cse.c as well
(doncha just love how many constant folders we have?)
zw