(subst, case SUREG):Only call force_to_mode if both inner and output
authorRichard Kenner <kenner@gcc.gnu.org>
Sun, 10 Oct 1993 14:57:01 +0000 (10:57 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 10 Oct 1993 14:57:01 +0000 (10:57 -0400)
modes are MODE_INT.

From-SVN: r5709

gcc/combine.c

index abc224cb97dc905b41d7069c38684c5fdbb77e1d..4d05b01ad88f9554aba0351056df0375beadaebf 100644 (file)
@@ -3177,11 +3177,13 @@ subst (x, from, to, in_dest, unique_copy)
          )
        return gen_lowpart_for_combine (mode, SUBREG_REG (x));
 
-      /* If we are narrowing the object, we need to see if we can simplify
-        the expression for the object knowing that we only need the
+      /* If we are narrowing an integral object, we need to see if we can
+        simplify the expression for the object knowing that we only need the
         low-order bits.  */
 
-      if (GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))
+      if (GET_MODE_CLASS (mode) == MODE_INT
+         && GET_MODE_CLASS (GET_MODE (SUBREG_REG (x))) == MODE_INT
+         && GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))
          && subreg_lowpart_p (x))
        return force_to_mode (SUBREG_REG (x), mode, GET_MODE_MASK (mode),
                              NULL_RTX);