OSDN Git Service

(force_to_mode, case ASHIFTRT): Verify that result of making a
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 10 Oct 1993 23:18:18 +0000 (23:18 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 10 Oct 1993 23:18:18 +0000 (23:18 +0000)
LSHIFTRT remains a shift.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5715 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/combine.c

index 4d05b01..fa34ce0 100644 (file)
@@ -5892,9 +5892,11 @@ force_to_mode (x, mode, mask, reg)
        x = gen_binary (LSHIFTRT, GET_MODE (x), XEXP (x, 0), XEXP (x, 1));
 
       /* If this is a sign-extension operation that just affects bits
-        we don't care about, remove it.  */
+        we don't care about, remove it.  Be sure the call above returned
+        something that is still a shift.  */
 
-      if (GET_CODE (XEXP (x, 1)) == CONST_INT
+      if ((GET_CODE (x) == LSHIFTRT || GET_CODE (x) == ASHIFTRT)
+         && GET_CODE (XEXP (x, 1)) == CONST_INT
          && INTVAL (XEXP (x, 1)) >= 0
          && (INTVAL (XEXP (x, 1))
              <= GET_MODE_BITSIZE (GET_MODE (x)) - (floor_log2 (mask) + 1))