WORD_REGISTER_OPERATIONS/LOAD_EXTEND_OP

Bernd Schmidt bernds@redhat.com
Wed Apr 11 06:26:00 GMT 2001


On Sat, 7 Apr 2001, Richard Earnshaw wrote:

> > Can someone tell me what assumptions are made by this piece of code in
> > combine.c (nonzero_bits):
>
> IIRC they are:
>
> (REG:mode1 x) has just been loaded from memory.
>
> mode1 < word size (mode2)
>
> loads of size mode1 zero- or sign-extend automatically to mode2.  That is,
> in effect
>
> (set (reg:mode1 x) (mem:mode1 ...))
>
> is equivalent to
>
> (set (reg:mode1 x) (subreg:mode1 (..._extend:mode2 (mem:mode1 ...)) 0))
>
> for this machine.

That's essentially what LOAD_EXTEND_OP means.  The question is, what exactly
does WORD_REGISTER_OPERATIONS mean?  Apparently, the code assumes that a
(subreg:mode2 (reg:mode1)) always has the upper half properly extended.
That's not the case, however: consider left shifts and (unsigned) additions
and subtractions.  To me it seems like the entire concept behind
WORD_REGISTER_OPERATIONS is flawed.

If no one objects, I will rip out this macro some time next week.


Bernd



More information about the Gcc mailing list