This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix Alpha reload ICE
On Tue, Dec 18, 2001 at 09:09:49PM -0800, Richard Henderson wrote:
> On Tue, Dec 18, 2001 at 03:22:46PM +0100, Jakub Jelinek wrote:
> > Richard, any ideas on what can be done about this?
>
> I'm surprised that the load to $27 is exposed for the call so early.
> It shouldn't be. It should be put in $27 by reload, who also knows
> about the "c" constraint on the divide pattern.
>
> I guess I'll look at it tomorrow. Test is ok.
Something like this might do the job (well, fixes the testcase).
2001-12-20 Jakub Jelinek <jakub@redhat.com>
* config/alpha/alpha.md (call_osf, call_value_osf): Use pseudo,
not $27 directly if not call_operand.
* config/alpha/alpha.c (call_operand): Accept any Pmode pseudo
for TARGET_ABI_OSF too.
--- gcc/config/alpha/alpha.md.jj Wed Dec 19 16:08:06 2001
+++ gcc/config/alpha/alpha.md Thu Dec 20 13:55:33 2001
@@ -4603,7 +4603,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi
operands[0] = XEXP (operands[0], 0);
if (! call_operand (operands[0], Pmode))
{
- rtx pv = gen_rtx_REG (Pmode, 27);
+ rtx pv = gen_reg_rtx (Pmode);
emit_move_insn (pv, operands[0]);
operands[0] = pv;
}
@@ -4736,7 +4736,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi
operands[1] = XEXP (operands[1], 0);
if (! call_operand (operands[1], Pmode))
{
- rtx pv = gen_rtx_REG (Pmode, 27);
+ rtx pv = gen_reg_rtx (Pmode);
emit_move_insn (pv, operands[1]);
operands[1] = pv;
}
--- gcc/config/alpha/alpha.c.jj Tue Dec 18 01:28:41 2001
+++ gcc/config/alpha/alpha.c Thu Dec 20 13:58:10 2001
@@ -1008,7 +1008,7 @@ call_operand (op, mode)
if (GET_CODE (op) == REG)
{
if (TARGET_ABI_OSF)
- return REGNO (op) == 27;
+ return (REGNO (op) == 27 || REGNO (op) >= FIRST_PSEUDO_REGISTER);
else
return 1;
}
Jakub