+Tue Jul 13 10:44:14 1999 Jeffrey A Law (law@cygnus.com)
+
+ * rs6000.c (find_addr_reg): Do not select r0 as an address
+ register.
+
Tue Jul 13 00:46:18 1999 Philippe De Muyter <phdm@macqel.be>
* m68k/x-mot3300 (XCFLAGS): List of big files now includes `cse.o'.
\f
/* Return a REG that occurs in ADDR with coefficient 1.
- ADDR can be effectively incremented by incrementing REG. */
+ ADDR can be effectively incremented by incrementing REG.
+
+ r0 is special and we must not select it as an address
+ register by this routine since our caller will try to
+ increment the returned register via an "la" instruction. */
struct rtx_def *
find_addr_reg (addr)
{
while (GET_CODE (addr) == PLUS)
{
- if (GET_CODE (XEXP (addr, 0)) == REG)
+ if (GET_CODE (XEXP (addr, 0)) == REG
+ && REGNO (XEXP (addr, 0)) != 0)
addr = XEXP (addr, 0);
- else if (GET_CODE (XEXP (addr, 1)) == REG)
+ else if (GET_CODE (XEXP (addr, 1)) == REG
+ && REGNO (XEXP (addr, 1)) != 0)
addr = XEXP (addr, 1);
else if (CONSTANT_P (XEXP (addr, 0)))
addr = XEXP (addr, 1);
else
abort ();
}
- if (GET_CODE (addr) == REG)
+ if (GET_CODE (addr) == REG && REGNO (addr) != 0)
return addr;
abort ();
}