simplify-rtx.c (simplify_rtx): Don't pass VOIDmode to simplify_relational_operation...
authorAlexandre Oliva <aoliva@redhat.com>
Wed, 23 Aug 2000 07:59:06 +0000 (07:59 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Wed, 23 Aug 2000 07:59:06 +0000 (07:59 +0000)
* simplify-rtx.c (simplify_rtx): Don't pass VOIDmode to
simplify_relational_operation() unless both operands are of
VOIDmode.
* cse.c (fold_rtx): Likewise.

From-SVN: r35904

gcc/ChangeLog
gcc/cse.c
gcc/simplify-rtx.c

index cef575916e19c97a94c76ad3acd3b370397974ac..33096a35db892a8bdb092ae4d40bd52f4915bdec 100644 (file)
@@ -1,3 +1,10 @@
+Wed Aug 23 04:55:48 2000  Alexandre Oliva  <aoliva@redhat.com>
+
+       * simplify-rtx.c (simplify_rtx): Don't pass VOIDmode to
+       simplify_relational_operation() unless both operands are of
+       VOIDmode.
+       * cse.c (fold_rtx): Likewise.
+
 Tue Aug 22 23:53:27 EDT 2000  John Wehle  (john@feith.com)
 
        * rtlanal.c (rtx_unstable_p): The pic register is stable
index 105420454f9fc12d2738cd3e89d87fa5c78528ed..7073f1eea9ef5ccca63ae31a4e4c589353f71ef9 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3858,7 +3858,19 @@ fold_rtx (x, insn)
            }
        }
 
-      new = simplify_relational_operation (code, mode_arg0,
+      new = simplify_relational_operation (code,
+                                          (mode_arg0 != VOIDmode
+                                           ? mode_arg0
+                                           : (GET_MODE (const_arg0
+                                                        ? const_arg0
+                                                        : folded_arg0)
+                                              != VOIDmode)
+                                           ? GET_MODE (const_arg0
+                                                       ? const_arg0
+                                                       : folded_arg0)
+                                           : GET_MODE (const_arg1
+                                                       ? const_arg1
+                                                       : folded_arg1)),
                                           const_arg0 ? const_arg0 : folded_arg0,
                                           const_arg1 ? const_arg1 : folded_arg1);
 #ifdef FLOAT_STORE_FLAG_VALUE
index e97e7b76a1b1251f984fc0bb2f9023b39db21e3f..701b7ba17216d20f4a4868a41512af52785018db 100644 (file)
@@ -1694,7 +1694,7 @@ simplify_relational_operation (code, mode, op0, op1)
   if (mode == VOIDmode
       && (GET_MODE (op0) != VOIDmode
          || GET_MODE (op1) != VOIDmode))
-    abort();
+    abort ();
 
   /* If op0 is a compare, extract the comparison arguments from it.  */
   if (GET_CODE (op0) == COMPARE && op1 == const0_rtx)
@@ -2091,7 +2091,10 @@ simplify_rtx (x)
                                         XEXP (x, 0), XEXP (x, 1), XEXP (x, 2));
 
     case '<':
-      return simplify_relational_operation (code, GET_MODE (XEXP (x, 0)),
+      return simplify_relational_operation (code,
+                                           (GET_MODE (XEXP (x, 0)) != VOIDmode
+                                            ? GET_MODE (XEXP (x, 0))
+                                            : GET_MODE (XEXP (x, 1))),
                                            XEXP (x, 0), XEXP (x, 1));
     default:
       return NULL;