[jh@suse.cz: Re: target/9929: [3.3/3.4 regression] Can't find spill register]

Jan Hubicka jh@suse.cz
Thu Apr 3 19:42:00 GMT 2003

> On Wed, Mar 26, 2003 at 11:16:42PM +0100, Jan Hubicka wrote:
> > Why reload insist on loading the whole 64bit register at all?
> *shrug* That's the way it's written.  I don't know if that's
> due to some edge condition somewhere or just laziness.

I was trying to dig into this deeper.  find_reloads_address_1
already appears to contain code supposed to do reload of subreg as a

    case SUBREG:
      if (GET_CODE (SUBREG_REG (x)) == REG)
          /* If this is a SUBREG of a hard register and the resulting register
             is of the wrong class, reload the whole SUBREG.  This avoids
             needless copies if SUBREG_REG is multi-word.  */
          /* If this is a SUBREG of a pseudo-register, and the pseudo-register
             is larger than the class size, then reload the whole SUBREG.  */
              enum reg_class class = (context ? INDEX_REG_CLASS
                                      : MODE_BASE_REG_CLASS (mode));
              if ((unsigned) CLASS_MAX_NREGS (class, GET_MODE (SUBREG_REG (x)))
                  > reg_class_size[class])
                  x = find_reloads_subreg_address (x, 0, opnum, type,
                                                   ind_levels, insn);
                  push_reload (x, NULL_RTX, loc, (rtx*) 0, class,
                               GET_MODE (x), VOIDmode, 0, 0, opnum, type);
                  return 1;
However the code does not appear to work at all - if I make it to happen
it always result in (subreg pseudo) after reload.
Interestingly enought, find_reloads appears to do the same for operands
containing subreg (reloading the outer expression) and it works there.
What goes wrong?  How is the code supposed to work?


More information about the Gcc-patches mailing list