SUBREG questions

Michael Matz matzmich@cs.tu-berlin.de
Fri Feb 23 12:09:00 GMT 2001


Hi,

On Fri, 23 Feb 2001, Joern Rennecke wrote:
> > The mismatch is this:  It's documented that stores into SUBREG's with a
> > smaller mode, leave the other bits in undefined state:
> >   "Storing in a non-paradoxical `subreg' has undefined results for
> >      bits belonging to the same word as the `subreg'."  (from docu of
>                       ^^^^^^^^^^^^^^^^
>
> It's no mismatch.  Bits belonging to other words remain unchanged.

Ahh OK, thanks for clarifying.  That makes things clean and easy ;)

> >   subreg RTL pattern), and
> >   "Likewise, if
> >      LVAL is a `subreg' whose machine mode is narrower than the mode of
> >      the register, the rest of the register can be changed in an
> >      undefined way."  (from docu to (set LVAL X) RTL pattern)
>
> This is not formulated exactly enough.  This is only meant to apply to
> extend to a word for pseudos, for a single hard register for hard registers.

So, this means, that a (set (subreg:SI ...)) never destroys anything
besides the hardreg behind that one subreg (if its a SImode hardreg), but
e.g. a (set (subreg:QI (reg:SI 123) 0)) destroys a
(subreg:QI (reg:SI 123) 1)?  (I'm asking all this in context of register
allocation only, that's why that 'hardreg "behind" the subreg')


Ciao,
Michael.



More information about the Gcc mailing list