Commit 02441cd6 by Jeffrey A Law Committed by Jeff Law

rs6000.c (find_addr_reg): Do not select r0 as an address register.

        * rs6000.c (find_addr_reg): Do not select r0 as an address
        register.

From-SVN: r28084
parent ac6fed4f
Tue Jul 13 10:45:58 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'.
......
......@@ -5697,7 +5697,11 @@ rs6000_encode_section_info (decl)
/* 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)
......@@ -5705,9 +5709,11 @@ 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);
......@@ -5716,7 +5722,7 @@ find_addr_reg (addr)
else
abort ();
}
if (GET_CODE (addr) == REG)
if (GET_CODE (addr) == REG && REGNO (addr) != 0)
return addr;
abort ();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment