This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch fold-const.c]: Add some missing optimizations about binary and and truth-not
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 20 Jun 2011 13:29:03 +0200
- Subject: Re: [patch fold-const.c]: Add some missing optimizations about binary and and truth-not
- References: <BANLkTimBwRC43m_xqRrisGXSDjNW7jNiTg@mail.gmail.com>
On Mon, Jun 20, 2011 at 12:23 PM, Kai Tietz <ktietz70@googlemail.com> wrote:
> Hello,
>
> this patch adds to fold_binary_loc some missing optimization for binary
> and operations on truth-not expressions.
> Added cases are:
> ?(!X & X) is always zero.
> ?(X & !X) is always zero.
> ?(X == 0) & X is always zero.
> ?X & (X == 0) is always zero.
> ?!X & 1 is X == 0
>
> ChangeLog
>
> 2011-06-20 ?Kai Tietz ?<ktietz@redhat.com>
>
> ? ? ? ?* fold-const.c (fold_binary_loc): Add missing
> ? ? ? ?folding for truth-not operations in combination
> ? ? ? ?with binary and.
>
> ChangeLog
>
> 2011-06-20 ?Kai Tietz ?<ktietz@redhat.com>
>
> ? ? ? ?* gcc.dg/binop-notand1.c: New test.
> ? ? ? ?* gcc.dg/binop-notand2.c: New test.
> ? ? ? ?* gcc.dg/binop-notand3.c: New test.
> ? ? ? ?* gcc.dg/binop-notand4.c: New test.
> ? ? ? ?* gcc.dg/binop-notand5.c: New test.
> ? ? ? ?* gcc.dg/binop-notand6.c: New test.
>
> Boostrapped and tested for x86_64-pc-linux-gnu. Ok for apply?
Ok.
Thanks,
Richard.
> Regards,
> Kai
>