> > Nothing will ever generate RTL matching this alternative.  Maybe long
> > ago this was needed, but not anymore.
> 
> Can you provide some reference for that assertion?
> 
> At some point GCC created shifts with zero shift count. It probably
> does not, but does a generic optimization prevent this?

All other SI shifts and all DI shifts do not have this.

The "O" alternative is not needed for correctness; "i" is still there.
With the patch, lshrsi3 by 0 generates a "srw" instead of a "mr".
Not a big deal since this can only happen (if at all) with optimisation
turned off.

Shifts by zero are not canonical RTL.  I checked everything in rs6000/
and nothing calls anything with lshr in the name with a shift count
of 0 (which is how almost all non-canonical RTL is created, for rs6000
at least: directly by the backend itself).

The code was added in 1996 ("Try to fix inline of fp/int convert");
sadly, our mail archives do not go that far back.  It's not clear to
me what exactly it fixed (or did not fix).  Looks like one of those
gen_lshrsi3(..., 0) things, if I had to guess.


Segher

Reply via email to