From patchwork Wed Aug 17 21:28:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Sayle X-Patchwork-Id: 56826 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9E3003858CDB for ; Wed, 17 Aug 2022 21:28:29 +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 C69023858D1E for ; Wed, 17 Aug 2022 21:28:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C69023858D1E 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=qC1D4m8cISnnSinju5VPvhyN+t++xDCGDJFTdGBKnJQ=; b=iGEoIWGQ5qRGhpfK4aGclc8/3h FkWB+jd11ENArmLbPwYSWkOd3gBOEHondmDeFDLaZYOUqRyTwqgwfXotV6iZelfJSq6BjjmX2YLUI AFR8+O8Xlle+omFGSHjnL6os9MjYmGsASsI23Ods83IgjXJUMw6/b8nEVHIV90gOjgN5JxED4aiqq Rhv1iMHlrpPRZJKrq7sL8yy/v7UIMM1hsn+k3tE6nU7538Cq2QYXPKCXke+Rqicd9JHRXcdWNQ8N5 aVUOAPwCFKDwFNzw2NMBDgXjzEoh1WTxiOQem7RbJuxuPlGpq6qkGN6G04QgDNuBtPIm7WSe7DOqU 1rCrA2GQ==; Received: from host86-169-41-119.range86-169.btcentralplus.com ([86.169.41.119]:54272 helo=Dell) by server.nextmovesoftware.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oOQaC-0002Vt-TI for gcc-patches@gcc.gnu.org; Wed, 17 Aug 2022 17:28:13 -0400 From: "Roger Sayle" To: "'GCC Patches'" Subject: [Committed] PR target/106640: Fix use of XINT in TImode compute_convert_gain. Date: Wed, 17 Aug 2022 22:28:11 +0100 Message-ID: <011f01d8b280$41a4ff80$c4eefe80$@nextmovesoftware.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: Adiyfjd+LgmpAnZfT86WEw+1HJ6VmA== 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=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Thanks to Zdenek Sojka for reporting PR target/106640 where an RTL checking build reveals a thinko in my recent patch to support TImode shifts/rotates in STV. My "senior moment" was to inappropriately use XINT where I should be using INTVAL of XEXP. I can't imagine what I was thinking. Corrected by the patch below, tested on x86_64-pc-linux-gnu with make bootstrap, both with and without --enable-checking=rtl, and regression tested, both with and without --target_board=unix{-m32}, with no new failures. Committed to mainline as obvious. 2022-08-17 Roger Sayle gcc/ChangeLog PR target/106640 * config/i386/i386-features.cc (timde_scalar_chain::compute_convert_gain): Replace incorrect use of XINT with INTVAL (XEXP (src, 1)). Roger diff --git a/gcc/config/i386/i386-features.cc b/gcc/config/i386/i386-features.cc index 821d8c7..d6bb66c 100644 --- a/gcc/config/i386/i386-features.cc +++ b/gcc/config/i386/i386-features.cc @@ -1248,7 +1248,7 @@ timode_scalar_chain::compute_convert_gain () case ASHIFT: case LSHIFTRT: /* See ix86_expand_v1ti_shift. */ - op1val = XINT (src, 1); + op1val = INTVAL (XEXP (src, 1)); if (optimize_insn_for_size_p ()) { if (op1val == 64 || op1val == 65) @@ -1282,7 +1282,7 @@ timode_scalar_chain::compute_convert_gain () case ASHIFTRT: /* See ix86_expand_v1ti_ashiftrt. */ - op1val = XINT (src, 1); + op1val = INTVAL (XEXP (src, 1)); if (optimize_insn_for_size_p ()) { if (op1val == 64 || op1val == 127) @@ -1355,7 +1355,7 @@ timode_scalar_chain::compute_convert_gain () case ROTATE: case ROTATERT: /* See ix86_expand_v1ti_rotate. */ - op1val = XINT (src, 1); + op1val = INTVAL (XEXP (src, 1)); if (optimize_insn_for_size_p ()) { scost = COSTS_N_BYTES (13);