This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
combine.c::known_cond
- From: law at redhat dot com
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 10 Dec 2001 15:56:33 -0700
- Subject: combine.c::known_cond
- Reply-to: law at redhat dot com
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;