From e6380233ffeef512f5db01c0543a37e68c61cb90 Mon Sep 17 00:00:00 2001 From: Jeffrey A Law Date: Thu, 2 Sep 1999 09:02:33 +0000 Subject: [PATCH] combine.c (simplify_rtx): Recognize another case of a synthesized sign extension. * combine.c (simplify_rtx): Recognize another case of a synthesized sign extension. From-SVN: r29055 --- gcc/ChangeLog | 3 +++ gcc/combine.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1a63096059c..42f596bbd45 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -13,6 +13,9 @@ Thu Sep 2 00:43:59 1999 Finn Hakansson Thu Sep 2 00:06:43 1999 Jeffrey A Law (law@cygnus.com) + * combine.c (simplify_rtx): Recognize another case of a synthesized + sign extension. + * varasm.c (mark_constant_pool): When marking indirect references, only look at SYMBOL_REFs. diff --git a/gcc/combine.c b/gcc/combine.c index 6886ba7179d..01703ba67f9 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3913,12 +3913,14 @@ simplify_rtx (x, op0_mode, last, in_dest) /* (plus (xor (and (const_int pow2 - 1)) ) <-c>) when c is (const_int (pow2 + 1) / 2) is a sign extension of a bit-field and can be replaced by either a sign_extend or a - sign_extract. The `and' may be a zero_extend. */ + sign_extract. The `and' may be a zero_extend and the two + , - constants may be reversed. */ if (GET_CODE (XEXP (x, 0)) == XOR && GET_CODE (XEXP (x, 1)) == CONST_INT && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT && INTVAL (XEXP (x, 1)) == - INTVAL (XEXP (XEXP (x, 0), 1)) - && (i = exact_log2 (INTVAL (XEXP (XEXP (x, 0), 1)))) >= 0 + && ((i = exact_log2 (INTVAL (XEXP (XEXP (x, 0), 1)))) >= 0 + || (i = exact_log2 (INTVAL (XEXP (x, 1)))) >= 0) && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT && ((GET_CODE (XEXP (XEXP (x, 0), 0)) == AND && GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 1)) == CONST_INT -- 2.30.2