From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1251) id 929753858401; Tue, 24 Aug 2021 21:08:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 929753858401 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Roger Sayle To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-3130] [Committed] PR middle-end/102031: Fix typo/mistake in simplify_truncation patch. X-Act-Checkin: gcc X-Git-Author: Roger Sayle X-Git-Refname: refs/heads/master X-Git-Oldrev: f95946afd160e2a1f4beac4ee5e6d5633307f39a X-Git-Newrev: 81e1894456bc6214c0c42148ff2b1bed142a3545 Message-Id: <20210824210848.929753858401@sourceware.org> Date: Tue, 24 Aug 2021 21:08:48 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2021 21:08:48 -0000 https://gcc.gnu.org/g:81e1894456bc6214c0c42148ff2b1bed142a3545 commit r12-3130-g81e1894456bc6214c0c42148ff2b1bed142a3545 Author: Roger Sayle Date: Tue Aug 24 22:07:41 2021 +0100 [Committed] PR middle-end/102031: Fix typo/mistake in simplify_truncation patch. My apologies again. My patch to simplify truncations of SUBREGs in simplify-rtx.c contained an error where I'd accidentally compared against a mode instead of the precision of that mode. Grr! It even survived regression testing on two platforms. Fixed below, and committed as obvious, after a full "make bootstrap" and "make -k check" on x86_64-pc-linux-gnu with no new regressions. 2021-08-24 Roger Sayle gcc/ChangeLog PR middle-end/102031 * simplify-rtx.c (simplify_truncation): When comparing precisions use "subreg_prec" variable, not "subreg_mode". Diff: --- gcc/simplify-rtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 8eea9fb7e0a..c81e27eb008 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -841,7 +841,7 @@ simplify_context::simplify_truncation (machine_mode mode, rtx op, { unsigned int int_op_prec = GET_MODE_PRECISION (int_op_mode); unsigned int subreg_prec = GET_MODE_PRECISION (subreg_mode); - if (int_op_prec > subreg_mode) + if (int_op_prec > subreg_prec) { if (int_mode == subreg_mode) return SUBREG_REG (op); @@ -851,7 +851,7 @@ simplify_context::simplify_truncation (machine_mode mode, rtx op, } /* Simplification of (truncate:A (subreg:B X:C 0)) where A is narrower than B and B is narrower than C. */ - else if (int_op_prec < subreg_mode + else if (int_op_prec < subreg_prec && GET_MODE_PRECISION (int_mode) < int_op_prec) return simplify_gen_unary (TRUNCATE, int_mode, SUBREG_REG (op), subreg_mode);