Commit f8d0a23d by Richard Henderson Committed by Richard Henderson

re PR target/46434 (crx-elf --enable-werror-always build fails)

PR target/46434
        * config/crx/crx.c (crx_addr_reg): Rename from crx_addr_reg_p;
        return the address register extracted.
        (crx_decompose_address): Update the extracted address register.

From-SVN: r167053
parent de9a793e
2010-11-22 Richard Henderson <rth@redhat.com>
PR target/46434
* config/crx/crx.c (crx_addr_reg): Rename from crx_addr_reg_p;
return the address register extracted.
(crx_decompose_address): Update the extracted address register.
2010-11-22 Dmitry Gorbachev <d.g.gorbachev@gmail.com> 2010-11-22 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
PR driver/43335 PR driver/43335
...@@ -590,30 +590,21 @@ crx_function_arg_regno_p (int n) ...@@ -590,30 +590,21 @@ crx_function_arg_regno_p (int n)
* Scaled index --> reg + reg | 22-bit disp. + reg + reg | * Scaled index --> reg + reg | 22-bit disp. + reg + reg |
* 22-disp. + reg + reg + (2 | 4 | 8) */ * 22-disp. + reg + reg + (2 | 4 | 8) */
static int crx_addr_reg_p (rtx addr_reg) static rtx
crx_addr_reg (rtx addr_reg)
{ {
rtx reg; if (GET_MODE (addr_reg) != Pmode)
return NULL_RTX;
if (REG_P (addr_reg)) if (REG_P (addr_reg))
{ return addr_reg;
reg = addr_reg; else if (GET_CODE (addr_reg) == SUBREG
}
else if ((GET_CODE (addr_reg) == SUBREG
&& REG_P (SUBREG_REG (addr_reg)) && REG_P (SUBREG_REG (addr_reg))
&& GET_MODE_SIZE (GET_MODE (SUBREG_REG (addr_reg))) && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (addr_reg)))
<= UNITS_PER_WORD)) <= UNITS_PER_WORD))
{ return SUBREG_REG (addr_reg);
reg = SUBREG_REG (addr_reg);
}
else else
return FALSE; return NULL_RTX;
if (GET_MODE (addr_reg) != Pmode)
{
return FALSE;
}
return TRUE;
} }
enum crx_addrtype enum crx_addrtype
...@@ -752,8 +743,18 @@ crx_decompose_address (rtx addr, struct crx_address *out) ...@@ -752,8 +743,18 @@ crx_decompose_address (rtx addr, struct crx_address *out)
return CRX_INVALID; return CRX_INVALID;
} }
if (base && !crx_addr_reg_p (base)) return CRX_INVALID; if (base)
if (index && !crx_addr_reg_p (index)) return CRX_INVALID; {
base = crx_addr_reg (base);
if (!base)
return CRX_INVALID;
}
if (index)
{
index = crx_addr_reg (index);
if (!index)
return CRX_INVALID;
}
out->base = base; out->base = base;
out->index = index; out->index = index;
......
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