This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem in gen_reload(), seeking an explanation


>            || (GET_CODE (op1) == REG
> -             && REGNO (op1) >= FIRST_PSEUDO_REGISTER))
> +             && REGNO (op1) >= FIRST_PSEUDO_REGISTER)
> +         || (GET_CODE (op0) == REG
> +             && REGNO (op0) < FIRST_PSEUDO_REGISTER
> +             && REGNO_REG_CLASS (REGNO (op0)) == GENERAL_REGS))
> +             && GET_CODE (op1) == REG
> +             && REGNO (op1) < FIRST_PSEUDO_REGISTER
> +             && REGNO_REG_CLASS (REGNO (op1)) != GENERAL_REGS))

REGNO_REG_CLASS will always give you a smallest register class that a
register belongs to.  So you might get a subclass of GENERAL_REGS.
Examples are the various letter-named one-register-classes on x86,
M16_REGS on mips, R0_REGS on SH.

So it's better to say:

TEST_HARD_REG_BIT (reg_class_contents[GENERAL_REGS], REGNO (op0))

but that will still not handle the case properly when an add can
operate on some register class that is not a subset of GENERAL_REGS.
I don't know if we have any target where this is an issue, though.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]