Do not fold constant comparisons
authorMichael Meissner <meissner@gcc.gnu.org>
Wed, 16 Sep 1992 18:52:31 +0000 (18:52 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Wed, 16 Sep 1992 18:52:31 +0000 (18:52 +0000)
From-SVN: r2136

gcc/config/mips/mips.c
gcc/config/mips/mips.h

index 5cae65b616faec3555d034693914250c16be1ece..3716aec7a074fae99e7de54063b94613857a1ae3 100644 (file)
@@ -1531,8 +1531,6 @@ map_test_to_internal_test (test_code)
 \f
 /* Generate the code to compare two integer values.  The return value is:
    (reg:SI xx)         The pseudo register the comparison is in
-   (const_int 0)       The comparison is always false
-   (const_int 1)       The comparison is always true
    (rtx)0              No register, generate a simple branch.  */
 
 rtx
@@ -1583,52 +1581,6 @@ gen_int_relational (test_code, result, cmp0, cmp1, p_invert)
   p_info = &info[ (int)test ];
   eqne_p = (p_info->test_code == XOR);
 
-  /* See if the test is always true or false.  */
-  if ((GET_CODE (cmp0) == REG || GET_CODE (cmp0) == SUBREG)
-      && GET_CODE (cmp1) == CONST_INT)
-    {
-      HOST_WIDE_INT value = INTVAL (cmp1);
-      rtx truth = (rtx)0;
-
-      if (test == ITEST_GEU && value == 0)
-       truth = const1_rtx;
-
-      else if (test == ITEST_LTU && value == 0)
-       truth = const0_rtx;
-
-      else if (!TARGET_INT64)
-       {
-         if (test == ITEST_LTU && value == -1)
-           truth = const1_rtx;
-
-         else if (test == ITEST_GTU && value == -1)
-           truth = const0_rtx;
-
-         else if (test == ITEST_LEU && value == -1)
-           truth = const1_rtx;
-
-         else if (test == ITEST_GT && value == 0x7fffffff)
-           truth = const0_rtx;
-
-         else if (test == ITEST_LE && value == 0x7fffffff)
-           truth = const1_rtx;
-
-         else if (test == ITEST_LT && value == 0x80000000)
-           truth = const0_rtx;
-
-         else if (test == ITEST_GE && value == 0x80000000)
-           truth = const1_rtx;
-       }
-
-      if (truth != (rtx)0)
-       {
-         if (result != (rtx)0)
-           emit_move_insn (result, truth);
-
-         return truth;
-       }
-    }
-
   /* Eliminate simple branches */
   branch_p = (result == (rtx)0);
   if (branch_p)
@@ -1813,41 +1765,6 @@ gen_conditional_branch (operands, test_code)
       break;
     }
 
-  /* Handle always true or always false cases directly */
-  if (GET_CODE (cmp0) == CONST_INT && GET_CODE (cmp1) == CONST_INT)
-    {
-      HOST_WIDE_INT sval0 = INTVAL (cmp0);
-      HOST_WIDE_INT sval1 = INTVAL (cmp1);
-      unsigned long uval0 = sval0;
-      unsigned long uval1 = sval1;
-      int truth                  = 0;
-
-      switch (test_code)
-       {
-       default:
-         goto fail;
-
-       case EQ:  truth = (sval0 == sval1); break;
-       case NE:  truth = (sval0 != sval1); break;
-       case GT:  truth = (sval0 >  sval1); break;
-       case GE:  truth = (sval0 >= sval1); break;
-       case LT:  truth = (sval0 <  sval1); break;
-       case LE:  truth = (sval0 <= sval1); break;
-       case GTU: truth = (uval0 >  uval1); break;
-       case GEU: truth = (uval0 >= uval1); break;
-       case LTU: truth = (uval0 <  uval1); break;
-       case LEU: truth = (uval0 <= uval1); break;
-       }
-
-      if (invert)
-       truth = ! truth;
-
-      if (truth)
-       emit_jump_insn (gen_rtx (SET, VOIDmode, pc_rtx, label1));
-
-      return;
-    }
-
   /* Generate the jump */
   if (invert)
     {
index 6ce78b96ea011594d63d90cc070facf7e2654f99..f7df3a038c17bd34f1411c6491f397338539fea0 100644 (file)
@@ -473,7 +473,7 @@ while (0)
 \f
 /* Print subsidiary information on the compiler version in use.  */
 
-#define MIPS_VERSION "[AL 1.1, MM 24]"
+#define MIPS_VERSION "[AL 1.1, MM 25]"
 
 #ifndef MACHINE_TYPE
 #define MACHINE_TYPE "BSD Mips"