combine.c (known_cond): Check mode of each operand to determine if COND is comparing...
authorJeffrey A Law <law@cygnus.com>
Mon, 10 Dec 2001 22:52:26 +0000 (22:52 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 10 Dec 2001 22:52:26 +0000 (15:52 -0700)
        * combine.c (known_cond): Check mode of each operand to determine
        if COND is comparing floating point values.

From-SVN: r47855

gcc/ChangeLog
gcc/combine.c

index a862ed7a866760b07c058b5b84e081d8c7a5b294..c519c15c4badebe37353947de5595366774e5caf 100644 (file)
@@ -1,3 +1,8 @@
+Mon Dec 10 15:54:27 2001  Jeffrey A Law  (law@cygnus.com)
+
+       * combine.c (known_cond): Check mode of each operand to determine
+       if COND is comparing floating point values.
+
 2001-12-10  David Edelsohn  <edelsohn@gnu.org>
 
        * rs6000.h (processor_type): Add PPC405.
index ee279196fc3243e96f89bcc8a72a2174d2819ce7..0e15def1fa8116124ce0b303081c7ac810631633 100644 (file)
@@ -7351,8 +7351,14 @@ known_cond (x, cond, reg, val)
   if (side_effects_p (x))
     return x;
 
-  if (cond == EQ && rtx_equal_p (x, reg) && !FLOAT_MODE_P (cond))
+  /* 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;