[PATCH] Fix Alpha reload ICE

Richard Henderson rth@redhat.com
Thu Dec 20 16:36:00 GMT 2001


On Thu, Dec 20, 2001 at 01:07:18PM +0100, Jakub Jelinek wrote:
> 	* 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.

I tested something very similar.  The only real difference is
using copy_to_mode_reg rather than continuing with emit_move_insn.


r~


        * config/alpha/alpha.c (call_operand) [OSF]: Accept pseudos.
        * config/alpha/alpha.md (call_osf, call_value_osf): Don't force
        operand into $27.

Index: alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.215
diff -c -p -d -r1.215 alpha.c
*** alpha.c	2001/12/17 15:05:26	1.215
--- alpha.c	2001/12/21 00:20:26
*************** call_operand (op, mode)
*** 1008,1014 ****
    if (GET_CODE (op) == REG)
      {
        if (TARGET_ABI_OSF)
! 	return REGNO (op) == 27;
        else
  	return 1;
      }
--- 1008,1014 ----
    if (GET_CODE (op) == REG)
      {
        if (TARGET_ABI_OSF)
! 	return (REGNO (op) == 27 || REGNO (op) >= FIRST_PSEUDO_REGISTER);
        else
  	return 1;
      }
Index: alpha.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.md,v
retrieving revision 1.168
diff -c -p -d -r1.168 alpha.md
*** alpha.md	2001/12/18 00:26:56	1.168
--- alpha.md	2001/12/21 00:20:26
*************** fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi
*** 4602,4612 ****
  
    operands[0] = XEXP (operands[0], 0);
    if (! call_operand (operands[0], Pmode))
!     {
!       rtx pv = gen_rtx_REG (Pmode, 27);
!       emit_move_insn (pv, operands[0]);
!       operands[0] = pv;
!     }
  })
  
  (define_expand "call_nt"
--- 4602,4608 ----
  
    operands[0] = XEXP (operands[0], 0);
    if (! call_operand (operands[0], Pmode))
!     operands[0] = copy_to_mode_reg (Pmode, operands[0]);
  })
  
  (define_expand "call_nt"
*************** fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi
*** 4735,4745 ****
  
    operands[1] = XEXP (operands[1], 0);
    if (! call_operand (operands[1], Pmode))
!     {
!       rtx pv = gen_rtx_REG (Pmode, 27);
!       emit_move_insn (pv, operands[1]);
!       operands[1] = pv;
!     }
  })
  
  (define_expand "call_value_nt"
--- 4731,4737 ----
  
    operands[1] = XEXP (operands[1], 0);
    if (! call_operand (operands[1], Pmode))
!     operands[1] = copy_to_mode_reg (Pmode, operands[1]);
  })
  
  (define_expand "call_value_nt"



More information about the Gcc-patches mailing list