This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR 33512 Folding of x & ((~x) | y) into x & y on the tree level
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Andrew Pinski <andrew dot pinski at caviumnetworks dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 17 Jan 2012 10:38:34 +0100
- Subject: Re: [PATCH] Fix PR 33512 Folding of x & ((~x) | y) into x & y on the tree level
- References: <CA+=Sn1kFkikJcCvjCk7W2e=ne06vM9yoBwfmr5u2oFesUBT7-A@mail.gmail.com>
On Tue, Jan 17, 2012 at 8:06 AM, Andrew Pinski
<andrew.pinski@caviumnetworks.com> wrote:
> Hi,
> ?This adds the folding of x & ((~x) | y)) into x & y on the tree
> level via fold-const.c
> There is already partly done on the RTL level but it would be a good
> thing for the tree level also.
>
>
> OK for 4.8 (yes I know we have not branched yet but I thought I would
> send it out so I don't forget about it)?
> Bootstrapped and tested on x86_64-linux-gnu with no regressions.
Can you instead patch tree-ssa-forwprop.c:simplify_bitwise_binary?
Thanks,
Richard.
> Thanks,
> Andrew Pinski
>
> ChangeLog:
> * fold-const.c (fold_binary_loc <case BIT_AND_EXPR>): Add folding of x
> & (~x | y) into x & y.
>
> testsuite/ChangeLog:
> * gcc.dg/tree-ssa/andor-3.c: New testcase.