Message ID | 20231202063725.3405094-2-quic_apinski@quicinc.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1614821vqy; Fri, 1 Dec 2023 22:38:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwFTJdYG8VkaQFqY4aWFiVkGk2EWhrYvWUGzk0uOQXqipfuGG7CmUezJJDXkXmTNnl6HxW X-Received: by 2002:ac8:5989:0:b0:41c:c6a6:338f with SMTP id e9-20020ac85989000000b0041cc6a6338fmr1233108qte.53.1701499094291; Fri, 01 Dec 2023 22:38:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701499094; cv=pass; d=google.com; s=arc-20160816; b=IzDj4ktVKCTdYHuqxNgC+bSY+STVjPsqTYUNfBHhsp+C/XfGFJVY0vMTRKAJS99a06 IJl/Fy5BM633m9Zfm6L3qobbpe2vjEApm5QKL1hogSrcWIDryHm6e34emS8aQrJ5Gwx5 krjeYDwIW0KMvbfGMMlFBWnVM0LztDQsekwHWmUqKLkjFF8AubHtAH+/lrg2E241xlEk mY46mmLi3VST72HXnAAp8GDcs/4m8As9P0M7T1rndyvQ+iEQICDBstSKG9lJjzDX4BBN NCPurrIyOHWtVYE3x7ziNZdQPiCAXBfaSs50/aiYgX69RQGGnMjmuWsNwN+WIyAmY6Qx LtQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=Gkv7QhbpLRuz6tKS4O2Lyi9JXixTZx0rfdAScjP2xSY=; fh=gk9A5O7Gbglvz1MjrRQ4hZ2i3c68kYkpOZJg1emXh+g=; b=HBsL/3fk5AvEZdcHd1JIUE9WT2DhPXyjnB9rX0GWsHuAvuck1pElLV95YCVTp0V6u1 u5dAmnglo7+o65M/vNhvG0TyqsL/W0lcfr4yl17pfBt4MPLoNLR9AHZiwTJz/GYvzNJi qWJfCQbpNtBGtJ4uIKiKHQjM3eiXP683t3c1MCoFUSz4G0IdycnqrlLgHK513oElp73/ YPgPJf/Mh8U5xS/wGOyJxvJx3/Sd189wnG2ZL9MqPtLL7KyUiTQvTCqI9YsvfSqJs0/a FHKKXIIRB4Cii986V74vHxGdhCjyluX8cmLYxYy21Sx2EVBht9lovkPRNSreuySPMK1B 0dtQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=AdCtySzy; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id fc8-20020a05622a488800b004239cba16b8si5157169qtb.80.2023.12.01.22.38.14 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 22:38:14 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=AdCtySzy; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 988C8385ED72 for <ouuuleilei@gmail.com>; Sat, 2 Dec 2023 06:38:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by sourceware.org (Postfix) with ESMTPS id 612BC385842E for <gcc-patches@gcc.gnu.org>; Sat, 2 Dec 2023 06:37:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 612BC385842E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=quicinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 612BC385842E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701499063; cv=none; b=smIknaHXi9hqzq/GGwycND77zsLheS89nuPfNvPVvay8bhXT3aX9WW9HIFva893MiRlNoBQ8P15Sz4iJWYjEjW+jzp9UUF8X3IBtYfwHNsE0zcumkTrG5V7WKIZ6elgWdE7gWHCYWUfN6rNLIFQXhbPD3ITpHbAWz/0WzrDx0ys= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701499063; c=relaxed/simple; bh=lQMKw+Bdyyl3xsqmehkf4xFk4/9qGKjq9iXkZuz1Dvs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RY96dXcrIjovPV5wZjP/wl368zrQFIkeVfsOVpIVXkmhDxJf6viv3krTQsoD5jCDB5Cb5KksqUDkMz8vDmm5pN5qSUp2xrTFKHCKshQ/gEc5zVrI3eYPv8vOnlmSOLr6b5xtWU5RGU2Rp1RYO7JYbh0zTj7OKi4/ga2m+TZR44E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B26OFIm030020 for <gcc-patches@gcc.gnu.org>; Sat, 2 Dec 2023 06:37:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=Gkv7QhbpLRuz6tKS4O2Lyi9JXixTZx0rfdAScjP2xSY=; b=AdCtySzyBwUOyxLotiUE+SwwZp2mA6206IxoUEps5ADCiLYs8UZ3rXPfpAq6cQg7CO9Q 9a2kmQtOfiQvzFgN+9L4GMFcGJydJ/ew8hvx2N5/Ty1AiJDTWv8dqkR2PitwcQrX9U7m y8g2VSXjocYPnKCHjVduG4HzkkjCiRFNeZoIJjd+9rbXt5EQrgEb4qB09gazwG+8jkXU hJYGvW+nE3LSAEd6PuV7P6vn5msK2oXCNaChIJXoO/OHZa8fc38tm9mLU1L98w8U2o6e HwR+AUwa7dKu6S8N5DjQr7pvtTq7lpOdhxfPY3y75s6jdHuL5UXhnVJqHpeCNFavJ1U/ Ow== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uqukg09fm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <gcc-patches@gcc.gnu.org>; Sat, 02 Dec 2023 06:37:41 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3B26beAn001611 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <gcc-patches@gcc.gnu.org>; Sat, 2 Dec 2023 06:37:40 GMT Received: from hu-apinski-lv.qualcomm.com (10.49.16.6) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 1 Dec 2023 22:37:40 -0800 From: Andrew Pinski <quic_apinski@quicinc.com> To: <gcc-patches@gcc.gnu.org> Subject: [PATCH 1/3] MATCH: Fix zero_one_valued_p's convert pattern Date: Fri, 1 Dec 2023 22:37:23 -0800 Message-ID: <20231202063725.3405094-2-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231202063725.3405094-1-quic_apinski@quicinc.com> References: <20231202063725.3405094-1-quic_apinski@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: aeb-XWy1OI8uNFX7NuCb2M5PRmVSoKgu X-Proofpoint-ORIG-GUID: aeb-XWy1OI8uNFX7NuCb2M5PRmVSoKgu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-02_04,2023-11-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 impostorscore=0 mlxlogscore=710 priorityscore=1501 suspectscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2312020047 X-Spam-Status: No, score=-13.4 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, 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.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784151114275312411 X-GMAIL-MSGID: 1784151114275312411 |
Series |
Fix PR 111972
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Andrew Pinski (QUIC)
Dec. 2, 2023, 6:37 a.m. UTC
While working on PR 111972, I was getting a regression
due to zero_one_valued_p matching a signed 1 bit integer
when it came to convert. This patch fixes that by checking
the outer type too.
Bootstrapped and tested on x86_64-linux-gnu with no regressions.
gcc/ChangeLog:
* match.pd (zero_one_valued_p): For convert
make sure type is not a signed 1-bit integer.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
---
gcc/match.pd | 3 +++
1 file changed, 3 insertions(+)
Comments
On Sat, Dec 2, 2023 at 7:38 AM Andrew Pinski <quic_apinski@quicinc.com> wrote: > > While working on PR 111972, I was getting a regression > due to zero_one_valued_p matching a signed 1 bit integer > when it came to convert. This patch fixes that by checking > the outer type too. > > Bootstrapped and tested on x86_64-linux-gnu with no regressions. OK > gcc/ChangeLog: > > * match.pd (zero_one_valued_p): For convert > make sure type is not a signed 1-bit integer. > > Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com> > --- > gcc/match.pd | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gcc/match.pd b/gcc/match.pd > index 26383e55767..4d554ba4721 100644 > --- a/gcc/match.pd > +++ b/gcc/match.pd > @@ -2247,6 +2247,9 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) > (if (INTEGRAL_TYPE_P (TREE_TYPE (@1)) > && (TYPE_UNSIGNED (TREE_TYPE (@1)) > || TYPE_PRECISION (TREE_TYPE (@1)) > 1) > + && INTEGRAL_TYPE_P (type) > + && (TYPE_UNSIGNED (type) > + || TYPE_PRECISION (type) > 1) > && wi::leu_p (tree_nonzero_bits (@1), 1)))) > > /* Transform { 0 or 1 } * { 0 or 1 } into { 0 or 1 } & { 0 or 1 }. */ > -- > 2.39.3 >
diff --git a/gcc/match.pd b/gcc/match.pd index 26383e55767..4d554ba4721 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -2247,6 +2247,9 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (if (INTEGRAL_TYPE_P (TREE_TYPE (@1)) && (TYPE_UNSIGNED (TREE_TYPE (@1)) || TYPE_PRECISION (TREE_TYPE (@1)) > 1) + && INTEGRAL_TYPE_P (type) + && (TYPE_UNSIGNED (type) + || TYPE_PRECISION (type) > 1) && wi::leu_p (tree_nonzero_bits (@1), 1)))) /* Transform { 0 or 1 } * { 0 or 1 } into { 0 or 1 } & { 0 or 1 }. */