From patchwork Thu Aug 26 17:54:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Sayle X-Patchwork-Id: 1521272 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=KxBPF1e/; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.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 4GwVqF6dM4z9sRN for ; Fri, 27 Aug 2021 03:54:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B6D643857C7F for ; Thu, 26 Aug 2021 17:54:47 +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 569983858402 for ; Thu, 26 Aug 2021 17:54:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 569983858402 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=Mbv8tbN6ieErCF7q4MMzJOEbfZoJt+wM0t6+alHZwRM=; b=KxBPF1e/rpW0+aU1Ea6gdlgFVb J+zuNOCnUF+9lH4VUW5gUAbagqMJHfMcheXZPT5i3KL6+weFBEh70RZo52MWej1OQkk2iut6EqKOp YyAdrjQnmPrQiuseO6UxoJVx2hLJZZqj81z6rQL2sQAzAld3tM41V1MH9he4AnPWo/sxr+/fQ5MjE yeFlChjvSkEqRPwVs7BAqd70YOGjP6xhIRh4acGQkocGIbCQZRVdT1LfHB94qCK0TrFsdME7yI1Im LQUlqq+8nvULS4+9iDLvfiXnJEKmTEB3T5nLwrVNl2CgxALNtIuJWCnjcB/38YS0Bxqei1FBXiWwW 9U9W22CA==; Received: from host86-163-217-120.range86-163.btcentralplus.com ([86.163.217.120]:63455 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 1mJJa3-0005YW-I3 for gcc-patches@gcc.gnu.org; Thu, 26 Aug 2021 13:54:23 -0400 From: "Roger Sayle" To: "'GCC Patches'" Subject: [Committed] Tidy up !POINTER_TYPE_P test in match.pd LSHIFT_EXPR folding Date: Thu, 26 Aug 2021 18:54:21 +0100 Message-ID: <001c01d79aa3$673bd480$35b37d80$@nextmovesoftware.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: Adeaorh3u0aQpEkHSgK5BatvzyIPPw== 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.2 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" As suggested by Richard Biener in the comments of PR middle-end/102029, the new test "INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type) ..." is redundant, and just "INTEGRAL_TYPE_P (type)" is the preferred form. Committed as obvious/pre-approved, after a "make bootstrap" and "make -k check" with no new failures on x86_64-pc-linux-gnu. 2021-08-26 Roger Sayle Richard Biener gcc/ChangeLog * match.pd (shift transformations): Remove a redundant !POINTER_TYPE_P check. Roger diff --git a/gcc/match.pd b/gcc/match.pd index e5bbb12..f421c74 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -3390,7 +3390,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (simplify (convert (lshift:s@0 (convert:s@1 @2) INTEGER_CST@3)) (if (INTEGRAL_TYPE_P (type) - && !POINTER_TYPE_P (type) && tree_nop_conversion_p (type, TREE_TYPE (@0)) && INTEGRAL_TYPE_P (TREE_TYPE (@2)) && TYPE_PRECISION (TREE_TYPE (@2)) <= TYPE_PRECISION (type))