(force_to_mode, LSHIFTRT case): Avoid shifts larger
authorJim Wilson <wilson@gcc.gnu.org>
Tue, 28 Sep 1993 23:00:13 +0000 (16:00 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 28 Sep 1993 23:00:13 +0000 (16:00 -0700)
than HOST_BITS_PER_WIDE_INT.

From-SVN: r5516

gcc/combine.c

index d6ce0348a4ff2710d8ab87ebad3232e5c12b72aa..45d572a7addcfd35f5e3b5e3d926a26716a892e2 100644 (file)
@@ -5771,10 +5771,12 @@ force_to_mode (x, mode, mask, reg)
       break;
 
     case LSHIFTRT:
-      /* Here we can only do something if the shift count is a constant and
-        we can do arithmetic in OP_MODE.  */
+      /* Here we can only do something if the shift count is a constant,
+        this shift constant is valid for the host, and we can do arithmetic
+        in OP_MODE.  */
 
       if (GET_CODE (XEXP (x, 1)) == CONST_INT
+         && INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT
          && GET_MODE_BITSIZE (op_mode) <= HOST_BITS_PER_WIDE_INT)
        {
          rtx inner = XEXP (x, 0);