This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: alphaev6-unknown-linux-gnu: error in extract_insn, at recog.c:2127


On Mon, Jul 23, 2001 at 02:20:44PM +0200, Toon Moene wrote:
> (insn/i 33 32 34 (set (reg:SF 78)
>         (if_then_else:SF (eq (reg:DF 85)
>                 (const_double:DF (cc0) 0 [0x0] 0 [0x0] [0]))
>             (reg:SF 78)
>             (reg:SF 84))) -1 (insn_list 32 (nil))

I have no idea how this was working before, or what exactly broke it.

What happens is that we compile this,

>       zc2(tt)=c2is + min(1.,max(0.,(tt-c3es+15)/15.))*( c2es-c2is )

which is a nested function.  Which causes us to hit this,

  /* Detect special cases.  But be careful we don't use a CONST_DOUBLE
     that's from a parent function since it may be in its constant pool.  */
  if (REAL_VALUES_IDENTICAL (dconst0, d)
      && (cfun == 0 || decl_function_context (current_function_decl) == 0))
    return CONST0_RTX (mode);

which causes us to *not* use the canonical value of "0.0" within the
nested function.  The problem being that there is a _lot_ of code that
checks for pointer equality against CONST0_RTX.  So we fail.

This is in desparate need of being cleaned up.

Given that code has not changed in ages.  I can only assume that
previously we weren't able to make the optimization.

As a workaround, give the following a try.


r~


Index: config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.175
diff -c -p -d -r1.175 alpha.c
*** alpha.c	2001/07/22 16:02:06	1.175
--- alpha.c	2001/07/25 00:39:34
*************** fp0_operand (op, mode)
*** 572,579 ****
       register rtx op;
       enum machine_mode mode;
  {
!   return (GET_MODE (op) == mode
! 	  && GET_MODE_CLASS (mode) == MODE_FLOAT && op == CONST0_RTX (mode));
  }
  
  /* Return 1 if OP is the floating-point constant zero or a register.  */
--- 572,587 ----
       register rtx op;
       enum machine_mode mode;
  {
!   int i;
! 
!   if (GET_MODE (op) != mode || GET_CODE (op) != CONST_DOUBLE)
!     return 0;
! 
!   for (i = GET_RTX_LENGTH (CONST_DOUBLE) - 1; i > 0; --i)
!     if (XWINT (op, i) != 0)
!       return 0;
! 
!   return 1;
  }
  
  /* Return 1 if OP is the floating-point constant zero or a register.  */
Index: config/alpha/alpha.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.h,v
retrieving revision 1.126
diff -c -p -d -r1.126 alpha.h
*** alpha.h	2001/07/22 16:02:06	1.126
--- alpha.h	2001/07/25 00:39:34
*************** enum reg_class { NO_REGS, PV_REG, GENERA
*** 767,773 ****
  
  #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)  			\
    ((C) == 'G' ? (GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_FLOAT	\
! 		 && (VALUE) == CONST0_RTX (GET_MODE (VALUE)))		\
     : (C) == 'H' ? (GET_MODE (VALUE) == VOIDmode				\
  		   && zap_mask (CONST_DOUBLE_LOW (VALUE))		\
  		   && zap_mask (CONST_DOUBLE_HIGH (VALUE)))		\
--- 767,773 ----
  
  #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)  			\
    ((C) == 'G' ? (GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_FLOAT	\
! 		 && fp0_operand ((VALUE), GET_MODE (VALUE)))		\
     : (C) == 'H' ? (GET_MODE (VALUE) == VOIDmode				\
  		   && zap_mask (CONST_DOUBLE_LOW (VALUE))		\
  		   && zap_mask (CONST_DOUBLE_HIGH (VALUE)))		\


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]