This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

fix ieee/compare-fp-1.c on alpha


The problem is that compare_from_rtx, via simplify-rtx.c, 
canonicalizes the comparison taking FLOAT_STORE_FLAG_VALUE
into account.  In doing so, it recognizes that it needn't
emit the compare pattern.  Since we didn't emit the compare,
the setcc pattern aborts.

Solved in the obvious manner.


r~


	* expmed.c (emit_store_flag): Cope with FLOAT_STORE_FLAG_VALUE.

Index: expmed.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expmed.c,v
retrieving revision 1.162
diff -c -p -d -r1.162 expmed.c
*** expmed.c	8 Jun 2004 04:30:48 -0000	1.162
--- expmed.c	9 Jun 2004 20:55:57 -0000
*************** emit_store_flag (rtx target, enum rtx_co
*** 4559,4569 ****
  
        comparison
  	= compare_from_rtx (op0, op1, code, unsignedp, mode, NULL_RTX);
!       if (GET_CODE (comparison) == CONST_INT)
! 	return (comparison == const0_rtx ? const0_rtx
! 		: normalizep == 1 ? const1_rtx
! 		: normalizep == -1 ? constm1_rtx
! 		: const_true_rtx);
  
        /* The code of COMPARISON may not match CODE if compare_from_rtx
  	 decided to swap its operands and reverse the original code.
--- 4559,4586 ----
  
        comparison
  	= compare_from_rtx (op0, op1, code, unsignedp, mode, NULL_RTX);
!       if (CONSTANT_P (comparison))
! 	{
! 	  if (GET_CODE (comparison) == CONST_INT)
! 	    {
! 	      if (comparison == const0_rtx)
! 		return const0_rtx;
! 	    }
! #ifdef FLOAT_STORE_FLAG_VALUE
! 	  else if (GET_CODE (comparison) == CONST_DOUBLE)
! 	    {
! 	      if (comparison == CONST0_RTX (GET_MODE (comparison)))
! 		return const0_rtx;
! 	    }
! #endif
! 	  else
! 	    abort ();
! 	  if (normalizep == 1)
! 	    return const1_rtx;
! 	  if (normalizep == -1)
! 	    return constm1_rtx;
! 	  return const_true_rtx;
! 	}
  
        /* The code of COMPARISON may not match CODE if compare_from_rtx
  	 decided to swap its operands and reverse the original code.


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