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]

combine.c::known_cond



As I pointed out on the main list yesterday, combine.c::known_cond is
treating an RTX_CODE as if it was a MACHINE_MODE.  This is not good.

This patch is the result of a brief discussion with Jan regarding the
intent of his code (wanted to test both operands of the condition to
see if either was a floating point value).

This has been bootstrapped & regression tested on my PA32 and ia32 boxes.
It also fixes the bootstrap comparison failure when bootstrapping 
an entire toolchain rather than just the compiler.

	* combine.c (known_cond): Check mode of each operand to determine
	if COND is comparing floating point values.

Index: combine.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/combine.c,v
retrieving revision 1.264.22.1
diff -c -3 -p -r1.264.22.1 combine.c
*** combine.c	2001/11/30 06:56:04	1.264.22.1
--- combine.c	2001/12/10 22:48:37
*************** known_cond (x, cond, reg, val)
*** 7351,7358 ****
    if (side_effects_p (x))
      return x;
  
!   if (cond == EQ && rtx_equal_p (x, reg) && !FLOAT_MODE_P (cond))
      return val;
    if (cond == UNEQ && rtx_equal_p (x, reg))
      return val;
  
--- 7351,7364 ----
    if (side_effects_p (x))
      return x;
  
!   /* If either operand of the condition is a floating point value,
!      then we have to avoid collapsing an EQ comparison.  */
!   if (cond == EQ
!       && rtx_equal_p (x, reg)
!       && ! FLOAT_MODE_P (GET_MODE (x))
!       && ! FLOAT_MODE_P (GET_MODE (val)))
      return val;
+ 
    if (cond == UNEQ && rtx_equal_p (x, reg))
      return val;
  






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