From patchwork Wed Apr 26 11:47:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1774061 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=MsftGKpw; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q5xxH2mSjz23vF for ; Wed, 26 Apr 2023 21:49:39 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 66F6A3855588 for ; Wed, 26 Apr 2023 11:49:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66F6A3855588 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682509777; bh=yuJHOzAtXD5BOwjR0Y7B4yJ/ER3dL1MrZ5buMa17gPs=; 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=MsftGKpwxcWfRSJ1Hd68vrvNJp3eqqIFghU7TPHRaFgdKqBNjZQ/4hXOM16Fnnbvg pwpyvm8w2WzfU6fb8Y5VMWTz80GbIUYIIu/0/Es+UUQou8pUET/6KTA+syW/MBmBSd U6MeSyvbSAfMqTUzBYJDuUoSvTagjzgeiRy04+Vg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 96A823858C20 for ; Wed, 26 Apr 2023 11:48:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 96A823858C20 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-554-6dWsUrCZPrmaOHr5Nxf8Lg-1; Wed, 26 Apr 2023 07:47:59 -0400 X-MC-Unique: 6dWsUrCZPrmaOHr5Nxf8Lg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D68E110146EC for ; Wed, 26 Apr 2023 11:47:58 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.195.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6ED682027043; Wed, 26 Apr 2023 11:47:58 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 33QBluIM336974 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 26 Apr 2023 13:47:56 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 33QBlufR336973; Wed, 26 Apr 2023 13:47:56 +0200 To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] Remove range_has_numeric_bounds_p. Date: Wed, 26 Apr 2023 13:47:51 +0200 Message-Id: <20230426114752.336928-6-aldyh@redhat.com> In-Reply-To: <20230426114752.336928-1-aldyh@redhat.com> References: <20230426114752.336928-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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: , X-Patchwork-Original-From: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" gcc/ChangeLog: * value-range.cc (irange::copy_legacy_to_multi_range): Rewrite use of range_has_numeric_bounds_p with irange API. (range_has_numeric_bounds_p): Delete. * value-range.h (range_has_numeric_bounds_p): Delete. --- gcc/value-range.cc | 12 +++--------- gcc/value-range.h | 1 - 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index da9098139ad..f7c3e7a00e2 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -979,7 +979,9 @@ irange::copy_legacy_to_multi_range (const irange &src) set_varying (src.type ()); else { - if (range_has_numeric_bounds_p (&src)) + if (!src.undefined_p () + && TREE_CODE (src.min ()) == INTEGER_CST + && TREE_CODE (src.max ()) == INTEGER_CST) set (src.min (), src.max (), src.kind ()); else { @@ -3068,14 +3070,6 @@ ranges_from_anti_range (const value_range *ar, return !vr0->undefined_p (); } -bool -range_has_numeric_bounds_p (const irange *vr) -{ - return (!vr->undefined_p () - && TREE_CODE (vr->min ()) == INTEGER_CST - && TREE_CODE (vr->max ()) == INTEGER_CST); -} - /* Return whether VAL is equal to the maximum value of its type. We can't do a simple equality comparison with TYPE_MAX_VALUE because C typedefs and Ada subtypes can produce types whose TYPE_MAX_VALUE diff --git a/gcc/value-range.h b/gcc/value-range.h index c1474a73eaf..b47540d49be 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -669,7 +669,6 @@ irange::legacy_mode_p () const return m_max_ranges == 1; } -extern bool range_has_numeric_bounds_p (const irange *); extern bool ranges_from_anti_range (const value_range *, value_range *, value_range *); extern value_range_kind get_legacy_range (const irange &, tree &min, tree &max);