This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Better info for combine results in worse code generated
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 30 May 2015 08:02:20 -0500
- Subject: Re: Better info for combine results in worse code generated
- Authentication-results: sourceware.org; auth=none
- References: <20150528143941 dot GL14752 at bubble dot grove dot modra dot org> <20150528194222 dot GA12574 at gate dot crashing dot org> <20150529031120 dot GN14752 at bubble dot grove dot modra dot org> <20150529125838 dot GA17397 at gate dot crashing dot org> <20150529135008 dot GO14752 at bubble dot grove dot modra dot org> <20150529150004 dot GA31466 at gate dot crashing dot org> <20150530011727 dot GR14752 at bubble dot grove dot modra dot org>
On Sat, May 30, 2015 at 10:47:27AM +0930, Alan Modra wrote:
> > > > I think this is too simplistic though. For example, AND with -7 is not
> > > > zero-extended (rlwinm rD,rA,0,31,28 sets the high 32 bits of rD to the low
> > > > 32 bits of rA).
> > >
> > > We take some pains in rs6000.md to ensure that the wrap-around case
> > > for rlwinm does not occur for TARGET_POWERPC64.
> >
> > I consider that a bug; it pessimises code.
>
> At the time I added the checks for wrap-around, I recall that gcc
> generated wrong code without the fix.
It still does: some of the things that use mask_operand cannot handle
a wrapped around (MB > ME) 32-bit mask in DImode.
> > > You'll find that an
> > > SImode AND with any value is in fact zero extending.
> >
> > int f(int x) { return x & 0xc0000000; }
> >
> > is a counter-example with current trunk (it does a rldicr).
>
> Huh, that does look like you've destroyed my claim about SImode AND.
Carefully worded :-)
I don't think it is a good idea to optimise code based on assumptions
of what SImode SETs will do to the dest seen as DImode, without making
those assumptions explicit in the RTL.
Segher