From patchwork Tue Aug 24 21:15:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Sayle X-Patchwork-Id: 1520444 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nextmovesoftware.com header.i=@nextmovesoftware.com header.a=rsa-sha256 header.s=default header.b=mm1/2dmL; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GvMNV235cz9sT6 for ; Wed, 25 Aug 2021 07:16:10 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 158C13858401 for ; Tue, 24 Aug 2021 21:16:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server.nextmovesoftware.com (server.nextmovesoftware.com [162.254.253.69]) by sourceware.org (Postfix) with ESMTPS id E283B3858405 for ; Tue, 24 Aug 2021 21:15:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E283B3858405 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nextmovesoftware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nextmovesoftware.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nextmovesoftware.com; s=default; h=Content-Type:MIME-Version:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8IQ34zmlgDOVpoo1CfwZzABR3bmuvrvJkUGnubDk9ks=; b=mm1/2dmL+phbwDbd/1lgAS4sFd BEdmCbn7rEFpxpXcobEj+Ghq0TF7HKw+/QFJGH6joPL93RtvTT8HYu0ISagcv3FG8MMRQdbQxQ62b Bho2F20vUsdXSlY09ozXGLvl2eZ03/dBH3UoMt10b7W6MZ7OP//YzZkdKCVJ3kyeNkJnNPVXpmH0T 1BzTWJXJ4wMJzlEfYt5DOnbadbCKpbQe3C3I2yItCO0gOTvrJP/J2aMNyc9PRWv6Pv2hW/ZVCRquK 9mqvl3o0ntpynPJQ5v/gPbqQ+W5SEJ8Ado82f3bsXz78ECZrxbjA0I4RhPJOsTOnK4ZzMvjsIB9g2 YrHsjDHQ==; Received: from host86-163-217-120.range86-163.btcentralplus.com ([86.163.217.120]:57650 helo=Dell) by server.nextmovesoftware.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mIdlr-0001UI-AO for gcc-patches@gcc.gnu.org; Tue, 24 Aug 2021 17:15:47 -0400 From: "Roger Sayle" To: "'GCC Patches'" Subject: [Committed] PR middle-end/102031: Fix typo/mistake in simplify_truncation patch Date: Tue, 24 Aug 2021 22:15:43 +0100 Message-ID: <00b601d7992d$340e9d30$9c2bd790$@nextmovesoftware.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdeZLLCaUu+7nkVIR3+/IdXkK5A8Yw== Content-Language: en-gb X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.nextmovesoftware.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - nextmovesoftware.com X-Get-Message-Sender-Via: server.nextmovesoftware.com: authenticated_id: roger@nextmovesoftware.com X-Authenticated-Sender: server.nextmovesoftware.com: roger@nextmovesoftware.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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". Roger diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 8eea9fb..c81e27e 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);