From patchwork Sat Dec 2 06:37:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Andrew Pinski (QUIC)" X-Patchwork-Id: 17434 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1614817vqy; Fri, 1 Dec 2023 22:38:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3SkJZa6wqSHAYJrooW6WbEzODBLAqEd8VVgkbwIk9th/yFL7NW9I/Rr7JqiNoGRS8tmx2 X-Received: by 2002:a05:620a:84b:b0:77d:5f48:9e7 with SMTP id u11-20020a05620a084b00b0077d5f4809e7mr839889qku.74.1701499093841; Fri, 01 Dec 2023 22:38:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701499093; cv=pass; d=google.com; s=arc-20160816; b=TzgZm4PAU6NqSkeCsDmx/S6Ni9GFNiGT97MiwUm7sz/0bkLMFp5iLUeFx8SDrPdTYM WuHsYU21hBK3G3AXr0h+HgBU3TKJed5YOxux3aeX9Y0saX7cFbO9EqjOoUhktrlW0thF /AGCnryKW0M3y2VBgvvq11bV6GsV55xTxwr0pdBbfiCagJaJYN0VtHvKYds21c6f6eWT MDF1G4VJR7RUjm4Mm8IcqB6e6xqzUJGKyZ17DyvI4Qs4iqa3ObTNvEOnNEle6wUCQ/DU 5Xx90em7b37LqhttTD02ilzJosIFGr/KYAWwmr07pDEtEz+0sUhfgfgKnNw0wSfnd4Sv CaIA== 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:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=+wBGK3VRkGLAFYAtJQUjWTLiEvMZyiChX1C8nY92aMA=; fh=gk9A5O7Gbglvz1MjrRQ4hZ2i3c68kYkpOZJg1emXh+g=; b=qb+/7I16fjZmMZUs6E7lBfe0FAwO5wHmEasR80kFQIMiCV635LIksx0C/r4QpTeF9C GJvnDWHWNfZTEajgE0kE9QNI0lPOjUju+dzk5Dr8cQ9hY1s88v3K/NE//Y/kts3UcpJA EGS7K4jmrbVYhC6kLWlFdsoIw1Sc64hYGiveIQZ9HigH9YPf0x53TI2pjBUAntARIY8z w1bqTx15As6hbuNhE0o7Av+qXvB2JpLPEtkFRudtRP8HonAp8yWLA5Ffg7X8/DuSf6Al xB3MxCTdjhytnJtKy3E6zlJg8HDgnD6HdY9P4ks0tSFCBkOwAAb93Xg5E6h13Qdky/tt +stQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JofjwrpS; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id r5-20020a05620a298500b0077d7a1568desi4962443qkp.740.2023.12.01.22.38.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 22:38:13 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JofjwrpS; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 265E7385700F for ; 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 3DFFD3858C98 for ; Sat, 2 Dec 2023 06:37:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3DFFD3858C98 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 3DFFD3858C98 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=bqlI/2T4EXpQPBKpfyA3MeDdY4IFp6FaFO4/RqjB2TcKSBwfHLlSJE94jqBjYjX+gYvP/GNl3XXzZw8h9KQQqlVdikyIxcgS3oAFzWvHkRY18InOZl7Ms+sTVD3g5snXchFjMerT1ZlzjOrNsK5wRTSTiWh+JrD+/ADBin95mpE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701499063; c=relaxed/simple; bh=3iZkfonYE2l74jgNW7my/Ee7m/h70hWQPjtiHE9+atU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RfSWZSk9lSqoxMGIPghPojRPbY1gprhfEYF6ChJGlYUPh70HN3zkaeakWCiIcdVYwjmICT/4D4hd/M7XkC9fLSxWkdm5asubYN4roGyaxN69jxJPKU+qgw6oL//MIB01F66WPTsKBsZSJ1WtivtITeWuZ4KI/KdbjNGXf14zqZw= 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 3B26bfF7022871 for ; Sat, 2 Dec 2023 06:37:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=+wBGK3VRkGLAFYAtJQUjWTLiEvMZyiChX1C8nY92aMA=; b=JofjwrpSgCQYBASWx+Rimr0C/gZXaKPkXBDcANdyy/IOLQ7DsztZvrMVbVwW2EQddAK1 jot4HWUQWW6GXl2zO5/pNRcZSCV22DLELAoLtxbsH9hEh+jm7luZgr/7vHAd6RfkECLC fwCq610dnbOX1TFdqX4XNzNQyhWWdDOFGP0IcKqqdukZBVWgnpCL/3t1yFtCm4+ZPSNZ 1K2gyO/1JpK2LqgACFzfvOkv51HVUKJqGh3eBf+xp2gOw/pc2XCf61RHPkEN2OGAU245 RCSW7zmL8eMUXhpK94ZhEpAnzo1VCWfruG3Ep38MimPtsJt75kw/zJWMOuOUerrFSt+w cQ== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uqukg09fk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; 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 3B26beEB001607 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; 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 To: Subject: [PATCH 0/3] Fix PR 111972 Date: Fri, 1 Dec 2023 22:37:22 -0800 Message-ID: <20231202063725.3405094-1-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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: XPswjfPaaOnf9SegJaiKju9qSPBqlGwi X-Proofpoint-ORIG-GUID: XPswjfPaaOnf9SegJaiKju9qSPBqlGwi 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=243 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=-6.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784151113479304325 X-GMAIL-MSGID: 1784151113479304325 This patch set fixes PR 111972 and the fallout from it. The first patch is a fix to zero_one_valued_p's convert pattern which I hit while running the testsuite with the last patch. The second patch is a fix for -fanalyzer which I had implemented with a different version of the 3rd patch while I was working at Marvell. And the 3rd patch fixes the issue by having the following as canonical forms: * `a ^ 1` is the canonical form of `(convert_back)(zero_one == 0)` (and `(convert_back)(zero_one != 1)`). * `(convert)a` is the canonical form of `(convert)(zero_one != 0)` (and `(convert)(zero_one == 1)`). Signed-off-by: Andrew Pinski Andrew Pinski (3): MATCH: Fix zero_one_valued_p's convert pattern Remove check of unsigned_char in maybe_undo_optimize_bit_field_compare. MATCH: (convert)(zero_one !=/== 0/1) for outer type and zero_one type are the same gcc/analyzer/region-model-manager.cc | 3 -- gcc/match.pd | 24 +++++++++++++++ gcc/testsuite/gcc.dg/tree-ssa/pr110637-1.c | 10 +++++++ gcc/testsuite/gcc.dg/tree-ssa/pr110637-2.c | 13 +++++++++ gcc/testsuite/gcc.dg/tree-ssa/pr110637-3.c | 14 +++++++++ gcc/testsuite/gcc.dg/tree-ssa/pr111972-1.c | 34 ++++++++++++++++++++++ gcc/testsuite/gcc.dg/tree-ssa/pr69270.c | 4 +-- gcc/testsuite/gcc.target/i386/pr110790-2.c | 16 ++++++++-- 8 files changed, 111 insertions(+), 7 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr110637-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr110637-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr110637-3.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr111972-1.c