This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR 33512 Folding of x & ((~x) | y) into x & y on the tree level


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]