This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem in gen_reload(), seeking an explanation
- To: Franz dot Sirl-kernel at lauterbach dot com (Franz Sirl)
- Subject: Re: Problem in gen_reload(), seeking an explanation
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Mon, 21 Jun 1999 15:55:41 +0100 (BST)
- Cc: law at cygnus dot com, egcs at egcs dot cygnus dot com
> || (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.