From patchwork Sat May 4 08:30:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1931247 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KN/v1TYr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VWgwT1QcZz23tp for ; Sat, 4 May 2024 18:35:21 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8CFE9386F420 for ; Sat, 4 May 2024 08:35:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [207.211.30.44]) by sourceware.org (Postfix) with ESMTPS id C4E5A3844754 for ; Sat, 4 May 2024 08:31:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C4E5A3844754 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=localhost.redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C4E5A3844754 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=207.211.30.44 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714811468; cv=none; b=n0Lf7R05x/MRJmuSX/dbcQ98ZIgTjxmGlsQ3sxAsdMV7aiaw2WpHiVOCHX7KdF3Gj6wOJPvyF2zTjAHRmJxGkZ4hMZmumccgwaEko0dKF5+YD+8KkqWPGOvDAPuqmAUmm73KxciRIFHeej5JOcDyrOwDRzBYC2Ww8T0VRoNHu8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714811468; c=relaxed/simple; bh=PvuMR0l9H4AxEV8OFBNh+qiCZi+4SFe4oNGTHwVpLn8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=yEbZXYtGUqjqcU9tTOeji1b4B3X7+KDM9Ieio3aMS1ShoJoI7l8zNarWFGXIXJAeuXjfN5aC9guZ8CGVZjKBZyFJ/c9NvxseVEDcDh+4Ayi8pqrZgPhNj2YlfsvRe12us11iNZsK4p81VTgA6xCapamJhd9SdW1X+rzdWnqrXfY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714811463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lVsKsEnTiTMVbhob4nVE9cMxOiwuEnKtqbIce1B9p+8=; b=KN/v1TYrbWd0SMtflKNHhe+oHyA6MWhmO4ZeKUXiaN9pWFgQQF3P7QjcknzVYpf8ockPKk iXv11YwT2UjuUPoUViXX8bQJkdgfWFQS7O7Q3Nbr2ZpjNN2HjppZ3W6PlmbzCW5aThdun9 bkbzXnHGoXQjBAJPkesXJoFQ6HvMxrg= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-639-LqTZNtFfNS-p4RpxkVbiHQ-1; Sat, 04 May 2024 04:31:01 -0400 X-MC-Unique: LqTZNtFfNS-p4RpxkVbiHQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E96B3C1014F for ; Sat, 4 May 2024 08:31:01 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3010EC01595; Sat, 4 May 2024 08:31:01 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.18.1/8.17.1) with ESMTPS id 4448Uxax139820 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 4 May 2024 10:31:00 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.18.1/8.18.1/Submit) id 4448UxjU139819; Sat, 4 May 2024 10:30:59 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED 09/23] Implement operator_cst for prange. Date: Sat, 4 May 2024 10:30:37 +0200 Message-ID: <20240504083056.139719-10-aldyh@redhat.com> In-Reply-To: <20240504083056.139719-1-aldyh@redhat.com> References: <20240504083056.139719-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NO_DNS_FOR_FROM, 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.30 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 gcc/ChangeLog: * range-op-mixed.h: Add overloaded declarations for pointer variants. * range-op-ptr.cc (operator_cst::fold_range): New. (operator_cst::pointers_handled_p): New. --- gcc/range-op-mixed.h | 4 ++++ gcc/range-op-ptr.cc | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h index 60aaea9563d..04c8acbd94a 100644 --- a/gcc/range-op-mixed.h +++ b/gcc/range-op-mixed.h @@ -380,9 +380,13 @@ public: bool fold_range (irange &r, tree type, const irange &op1, const irange &op2, relation_trio rel = TRIO_VARYING) const final override; + bool fold_range (prange &r, tree type, + const prange &op1, const prange &op2, + relation_trio rel = TRIO_VARYING) const final override; bool fold_range (frange &r, tree type, const frange &op1, const frange &op2, relation_trio = TRIO_VARYING) const final override; + bool pointers_handled_p (range_op_dispatch_type, unsigned) const final override; }; diff --git a/gcc/range-op-ptr.cc b/gcc/range-op-ptr.cc index 08419bfc798..e59e278cbd7 100644 --- a/gcc/range-op-ptr.cc +++ b/gcc/range-op-ptr.cc @@ -683,6 +683,29 @@ operator_identity::pointers_handled_p (range_op_dispatch_type type, } } +bool +operator_cst::fold_range (prange &r, tree type ATTRIBUTE_UNUSED, + const prange &lh, + const prange & ATTRIBUTE_UNUSED, + relation_trio) const +{ + r = lh; + return true; +} + +bool +operator_cst::pointers_handled_p (range_op_dispatch_type type, + unsigned dispatch) const +{ + switch (type) + { + case DISPATCH_FOLD_RANGE: + return dispatch == RO_PPP; + default: + return true; + } +} + // Initialize any pointer operators to the primary table void