Reload bug

Jan Hubicka jh@suse.cz
Wed Apr 9 09:49:00 GMT 2003


> > How it did detected that?
> 
>   /* If the outer part is a word or smaller, INNER larger than a
>      word and the number of regs for INNER is not the same as the
>      number of words in INNER, then INNER will need reloading.  */
>   return (GET_MODE_SIZE (mode) <= UNITS_PER_WORD
> 	  && GET_MODE_SIZE (GET_MODE (inner)) > UNITS_PER_WORD
> 	  && ((GET_MODE_SIZE (GET_MODE (inner)) / UNITS_PER_WORD)
> 	      != HARD_REGNO_NREGS (REGNO (inner), GET_MODE (inner))))
> 
> > I believe it is just pessimization masking a bug as currently there is no
> > way how to realize that subreg:SI of MMX with offset 4 register is not 
> > valid (and with offset 0 is).
> 
> Of course, it's pessimization when offset ==0, but it's correctness when 
> offset == 4. As for the choice between correctness and pessimization...
> 
> > It should not get recognized earlier than in reload as we should not
> > allocate value with subreg undoable in MMX register into MMX register
> > (unless rest of insns dictates otherwise).  We've chatted about this
> > with Richard
> 
> Then the culprit is local alloc.

This is approximately what the patch I quoted does - it makes regclass
to realize that it can't change mode this way.  (it is not correct
either as it prohibits (subreg:SI xmm:DI 0) that is valid but we don't
have interface to declare this properly.
> 
> > No, it is valid for high parts too as long as the register is possible
> > (imagine the xmm being replaced by eax).  I think we can add extra test
> > realizing how large the registers are when index is nonzero.  This will
> > get bit tricky to get right when indexes are nonzero for lowparts.
> 
> Then why not use ! lowpart?

Because you can still have (subreg:sI eax:DI 4)

Honza
> 
> -- 
> Eric Botcazou



More information about the Gcc mailing list