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: match.pd: Optimize (x & y) ^ (x | y)


On Thu, Jun 11, 2015 at 01:09:05PM +0200, Jakub Jelinek wrote:
> What about some nop type conversions in between?
> int
> fn1 (unsigned int x, unsigned int y)
> {
>   int a = x;
>   int b = y;
>   unsigned int c = x & y;
>   int d = a | b;
>   return (int) (c ^ d);
> }
> ?  Also wonder, if some testcases for match.pd shouldn't be

It doesn't work then.  Adding some convert?s into the pattern didn't help
either.  Note that similar patterns don't use convert?s either, so I'm
inclined to keep the pattern as is was.

> in separate statements so that they don't test the GENERIC folding,
> but GIMPLE folding.

Sure - fixed in second version of the patch that I'm regtesting right now.

	Marek


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