From: Richard Kenner Date: Sun, 10 Oct 1993 23:18:18 +0000 (-0400) Subject: (force_to_mode, case ASHIFTRT): Verify that result of making a X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c002f291a3611fb7e18248b7c230b7339077846;p=gcc.git (force_to_mode, case ASHIFTRT): Verify that result of making a LSHIFTRT remains a shift. From-SVN: r5715 --- diff --git a/gcc/combine.c b/gcc/combine.c index 4d05b01ad88..fa34ce00f51 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -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))