From 4c002f291a3611fb7e18248b7c230b7339077846 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sun, 10 Oct 1993 19:18:18 -0400 Subject: [PATCH] (force_to_mode, case ASHIFTRT): Verify that result of making a LSHIFTRT remains a shift. From-SVN: r5715 --- gcc/combine.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)) -- 2.30.2