From patchwork Fri Feb 17 21:45:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 58781 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp82849wrn; Fri, 17 Feb 2023 13:46:40 -0800 (PST) X-Google-Smtp-Source: AK7set/4HQdHKxBC6UvGIeLdS8K0XhWHB7fY06e2h57L0tPv2AeP+NQfQUI1AlvyzIZ5AmYuoY0O X-Received: by 2002:a17:906:818:b0:878:8249:bef6 with SMTP id e24-20020a170906081800b008788249bef6mr354911ejd.59.1676670400787; Fri, 17 Feb 2023 13:46:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676670400; cv=none; d=google.com; s=arc-20160816; b=Daqu2CbJFGP4pHZ8MNS2r0nvlUH58L05zP2TNidhT+th5GaMdIvD4qMjYwYbrnaj+F +/qjYC8da6CXViGrlU2Lvsgw0PIXznAhbGQE+orJqm3/JqGZ7M9YML84CBmx4Gr451WZ H5s+B/zsW8KktJfZ+i6OdDMyYaC7jYBkArAq9pxrx935qWAKVLnroB7fyxJOHZ0DokFh Q+X8CiwX9FUXb3G8fHCp0Jhit8D3ezv5OOE9Ciq0VQoobE+M7Mursh6Nu/ELxd95CywP 6HPJ11NXk0tp+dfokF/09n4VvrG5GtZ9mboDrxJzrPLDcdqa+rBsHbjJdQgKJWEhwB2p IlTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=W+rFsSWVy1Gz2Gv+ASKOCwvSE/Ldqftd+O2zrxXATGg=; b=m6nS/UqLUilSnmF/bpNWjCu9nK7CIPxfKO2Juw/cSEM7o3s03TZfN7q5QfAUXZeMxK fQRuiqkm2rIAEUlKHA2oqBpL2qEk9WJQ/fK3exzl/Y2ivrMbdaI5Q28hnJm5aPxayQwN hiywMJGXuLqHVG/jlKfiBIAV7geGeWkaezsvKQsqMmbtBHhFyQ5OrRZWrpo/jMoNpenI dX1iszdKGmYxWIXTsRGhR01Al/wifD1vyy2SndEX6POZLpwJUGAbRG9NDQXr2b296Y7V /fQf8YFF4v+MHO3kU9jZfb9JYNuT1DRkfnA/9UGRVZMFcI98xWvSLjyx506NEgbbl822 9V6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Mgp1EO7K; 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=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id 9-20020a17090600c900b0088de3d552e0si6670527eji.859.2023.02.17.13.46.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 13:46:40 -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=@gcc.gnu.org header.s=default header.b=Mgp1EO7K; 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 721E7387101B for ; Fri, 17 Feb 2023 21:46:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 721E7387101B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676670393; bh=W+rFsSWVy1Gz2Gv+ASKOCwvSE/Ldqftd+O2zrxXATGg=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Mgp1EO7KAzPsYMBUEJcW2juAMcNpPUMw1N9CyZ9K28ZqbOU28Ssof5yqv+YhYOAUS ynO5e6ndy/KAGYC3k5Nr1XQM5V+KwWTRV1kl9zNFi9+sIBS0j73+P/w7JrpQjVNKMN X0MTJ8+o0mJHkwb/VUCW13etDH71czGnSWH50h/k= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by sourceware.org (Postfix) with ESMTPS id 6A6B4385828E for ; Fri, 17 Feb 2023 21:45:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6A6B4385828E Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31HJQ2Us010621 for ; Fri, 17 Feb 2023 13:45:48 -0800 Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3nsg88drs8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 17 Feb 2023 13:45:48 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 17 Feb 2023 13:45:46 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Fri, 17 Feb 2023 13:45:46 -0800 Received: from vpnclient.wrightpinski.org.com (unknown [10.69.242.67]) by maili.marvell.com (Postfix) with ESMTP id 434FE5B6925; Fri, 17 Feb 2023 13:45:46 -0800 (PST) To: CC: Andrew Pinski Subject: [PATCH 1/2] Support get_range_query with a nullptr argument Date: Fri, 17 Feb 2023 13:45:37 -0800 Message-ID: <20230217214538.2177094-1-apinski@marvell.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: bh3iYFpT43N0JeNwFvOtY8QeimU1v_SL X-Proofpoint-GUID: bh3iYFpT43N0JeNwFvOtY8QeimU1v_SL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-17_15,2023-02-17_01,2023-02-09_01 X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP 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: , X-Patchwork-Original-From: Andrew Pinski via Gcc-patches From: Andrew Pinski Reply-To: Andrew Pinski Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758116341928242932?= X-GMAIL-MSGID: =?utf-8?q?1758116341928242932?= get_range_query didn't support a nullptr argument before and would crash. See also the thread at https://inbox.sourceware.org/gcc/4f6718af-e17a-41ef-a886-f45e4ac3d7a4@redhat.com/T/ OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * value-query.h (get_range_query): Return the global ranges for a nullptr func. --- gcc/value-query.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/value-query.h b/gcc/value-query.h index 63878968118..2d7bf8fcf33 100644 --- a/gcc/value-query.h +++ b/gcc/value-query.h @@ -140,7 +140,7 @@ get_global_range_query () ATTRIBUTE_RETURNS_NONNULL inline range_query * get_range_query (const struct function *fun) { - return fun->x_range_query ? fun->x_range_query : &global_ranges; + return (fun && fun->x_range_query) ? fun->x_range_query : &global_ranges; } // Query the global range of NAME in function F. Default to cfun. From patchwork Fri Feb 17 21:45:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 58782 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp82865wrn; Fri, 17 Feb 2023 13:46:42 -0800 (PST) X-Google-Smtp-Source: AK7set8/kFchNyicN/UPyZHtue/dCXfodpSYFApnoGIOFzy74rXn7juyX8NLyXDfG2Ytvg+DtBQ4 X-Received: by 2002:aa7:c845:0:b0:4ac:bf55:7d69 with SMTP id g5-20020aa7c845000000b004acbf557d69mr1816919edt.42.1676670402400; Fri, 17 Feb 2023 13:46:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676670402; cv=none; d=google.com; s=arc-20160816; b=FS0sggnL9TXCUaQAErJgHQJ4mGTve8WyMnlempeVkZrfcTNEiX6fowygqfQEURgZrV K0JGy+8/acEFY8Pg5GW5dxwi2uy/6WM5vvc8RbPEIdSA1aZGg9sVSBckss3y2QW57G1F KldUDkEGxfSauDpk22M/9Qlmse2l5wq92tUh8nj5jChIv5hFZngxnxi+uF5wyi9O5BkT CQTjBAx4OJCWL2K1UvYFt8Le6IOxA4jk3sSUt5d9p1uaDCxJyAdnqn2IaZG3GIwCcvij jdc009Fy/RFOWj4T5KPxioJEyFCzklTj+uWOizdJbSnd7q+P8xx7uzab5IRrPR7RvoQK cLWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from: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:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=NrraY+/do+Ru/qZW25fXk9Bffqn8PMFyOioF0BwwI8U=; b=D6XqMXkRJVaEU1Frrc5hJkHVa8L0igqBHPaEJ2bfV4CJhAI7Eqy6YNGtj4fUWQyzC3 Oim3a2B1Vq+W4fKQ5EbNPxFiJdu1pcT6/TqtIKVMsH0N/+lsdQKjpQanKvfT874SE3OW t07ZvQZcaQBZi3t4U7i78XJZtH3pW2ByJ92VcVkWHYUgvc2GBJBWkykk1C/bccxdNIi5 E4zP+BLoGCSy27nMoOtLf8RZ+QanQGN7Wp/1bIyjkepXfYnNtDeRoXZ3MHAZQRR7ngOf RbbgPSSR2YP0/lSHsjob53ZDr3DtVFXNP30Ax1x+PCbMR9QRQgzFeTE94xixiPupwkx0 jNsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pAfCU3gq; 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=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id r2-20020aa7d142000000b004ab1736d82csi6539855edo.354.2023.02.17.13.46.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 13:46:42 -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=@gcc.gnu.org header.s=default header.b=pAfCU3gq; 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 87484383DB8C for ; Fri, 17 Feb 2023 21:46:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 87484383DB8C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676670394; bh=NrraY+/do+Ru/qZW25fXk9Bffqn8PMFyOioF0BwwI8U=; h=To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=pAfCU3gqM6BCjwSeI9yVFM1WRA2nGWXgdq8T/0geNkM1uBNjExI7bZNM7h1RaVfIs 8Bj0tkrHjheU0dyJJStqR7KEptmx5WzKiTcGCOYYc3w8h9m5mZfGgnpnNyITWDr+J3 TnqmTrDXoxLelob07GkHbjv96L5XPwIX89zj244M= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by sourceware.org (Postfix) with ESMTPS id 6B2343858291 for ; Fri, 17 Feb 2023 21:45:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B2343858291 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31HJQ2Ut010621 for ; Fri, 17 Feb 2023 13:45:48 -0800 Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3nsg88drs8-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 17 Feb 2023 13:45:48 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 17 Feb 2023 13:45:47 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Fri, 17 Feb 2023 13:45:47 -0800 Received: from vpnclient.wrightpinski.org.com (unknown [10.69.242.67]) by maili.marvell.com (Postfix) with ESMTP id B74825B6929; Fri, 17 Feb 2023 13:45:46 -0800 (PST) To: CC: Andrew Pinski Subject: [PATCH 2/2] Remove #if GIMPLE around 1 - a pattern Date: Fri, 17 Feb 2023 13:45:38 -0800 Message-ID: <20230217214538.2177094-2-apinski@marvell.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230217214538.2177094-1-apinski@marvell.com> References: <20230217214538.2177094-1-apinski@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 3fUvnlmqf4EPEUEHHF0-fExGuturw7XW X-Proofpoint-GUID: 3fUvnlmqf4EPEUEHHF0-fExGuturw7XW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-17_15,2023-02-17_01,2023-02-09_01 X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP 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: , X-Patchwork-Original-From: Andrew Pinski via Gcc-patches From: Andrew Pinski Reply-To: Andrew Pinski Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758116343570787829?= X-GMAIL-MSGID: =?utf-8?q?1758116343570787829?= This removes the "#if GIMPLE" around the "1 - a" pattern as ssa_name_has_boolean_range (get_range_query) works when cfun is a nullptr. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * match.pd: Remove #if GIMPLE around the "1 - a" pattern --- gcc/match.pd | 2 -- 1 file changed, 2 deletions(-) diff --git a/gcc/match.pd b/gcc/match.pd index e7b700349a6..e352bd422f5 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -1732,7 +1732,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (if (!FIXED_POINT_TYPE_P (type)) (plus @0 (negate @1)))) -#if GIMPLE /* 1 - a is a ^ 1 if a had a bool range. */ /* This is only enabled for gimple as sometimes cfun is not set for the function which contains @@ -1743,7 +1742,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (if (INTEGRAL_TYPE_P (type) && ssa_name_has_boolean_range (@1)) (bit_xor @1 @0))) -#endif /* Other simplifications of negation (c.f. fold_negate_expr_1). */ (simplify