From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 48EE73858C3A for ; Wed, 26 Apr 2023 08:34:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 48EE73858C3A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682498049; 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=9p4ydXJc44fQoUZGSYB/d13m6M6F8NBtczDLDfDwMgY=; b=Bq5PlcZ5lq22CbDtTuQiQNMMGXNRPSr5y/x6/wcaq9/TUX1zrY0XAcE7Snc8iAOoJiulJk /v4BLIS4QhESFYqWkCHVs6myv0p2MReEJxbUQHyArRIx1cq2vbQh6Xq31i6koTBrCncSOQ 18p6jB644uJ04LS78y0d1lcchj7aH6U= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-171--gvfTYiTMhG7a_PjlkcLFw-1; Wed, 26 Apr 2023 04:34:08 -0400 X-MC-Unique: -gvfTYiTMhG7a_PjlkcLFw-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 1D02E281722A for ; Wed, 26 Apr 2023 08:34:08 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.195.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A8E242027043; Wed, 26 Apr 2023 08:34:07 +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 33Q8Y5mb313614 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 26 Apr 2023 10:34:05 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 33Q8Y55D313613; Wed, 26 Apr 2023 10:34:05 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] Remove range_fold_{unary,binary}_expr. Date: Wed, 26 Apr 2023 10:33:24 +0200 Message-Id: <20230426083328.313566-5-aldyh@redhat.com> In-Reply-To: <20230426083328.313566-1-aldyh@redhat.com> References: <20230426083328.313566-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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.7 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 List-Id: gcc/ChangeLog: * tree-vrp.cc (supported_types_p): Remove. (defined_ranges_p): Remove. (range_fold_binary_expr): Remove. (range_fold_unary_expr): Remove. * tree-vrp.h (range_fold_unary_expr): Remove. (range_fold_binary_expr): Remove. --- gcc/tree-vrp.cc | 86 ------------------------------------------------- gcc/tree-vrp.h | 5 --- 2 files changed, 91 deletions(-) diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc index 9b870640e23..27126088708 100644 --- a/gcc/tree-vrp.cc +++ b/gcc/tree-vrp.cc @@ -587,92 +587,6 @@ compare_values (tree val1, tree val2) return compare_values_warnv (val1, val2, &sop); } -/* If the types passed are supported, return TRUE, otherwise set VR to - VARYING and return FALSE. */ - -static bool -supported_types_p (value_range *vr, - tree type0, - tree = NULL) -{ - if (!value_range::supports_p (type0)) - { - vr->set_varying (type0); - return false; - } - return true; -} - -/* If any of the ranges passed are defined, return TRUE, otherwise set - VR to UNDEFINED and return FALSE. */ - -static bool -defined_ranges_p (value_range *vr, - const value_range *vr0, const value_range *vr1 = NULL) -{ - if (vr0->undefined_p () && (!vr1 || vr1->undefined_p ())) - { - vr->set_undefined (); - return false; - } - return true; -} - -/* Perform a binary operation on a pair of ranges. */ - -void -range_fold_binary_expr (value_range *vr, - enum tree_code code, - tree expr_type, - const value_range *vr0_, - const value_range *vr1_) -{ - if (!supported_types_p (vr, expr_type) - || !defined_ranges_p (vr, vr0_, vr1_)) - return; - range_op_handler op (code, expr_type); - if (!op) - { - vr->set_varying (expr_type); - return; - } - - value_range vr0 (*vr0_); - value_range vr1 (*vr1_); - if (vr0.undefined_p ()) - vr0.set_varying (expr_type); - if (vr1.undefined_p ()) - vr1.set_varying (expr_type); - vr0.normalize_addresses (); - vr1.normalize_addresses (); - if (!op.fold_range (*vr, expr_type, vr0, vr1)) - vr->set_varying (expr_type); -} - -/* Perform a unary operation on a range. */ - -void -range_fold_unary_expr (value_range *vr, - enum tree_code code, tree expr_type, - const value_range *vr0, - tree vr0_type) -{ - if (!supported_types_p (vr, expr_type, vr0_type) - || !defined_ranges_p (vr, vr0)) - return; - range_op_handler op (code, expr_type); - if (!op) - { - vr->set_varying (expr_type); - return; - } - - value_range vr0_cst (*vr0); - vr0_cst.normalize_addresses (); - if (!op.fold_range (*vr, expr_type, vr0_cst, value_range (expr_type))) - vr->set_varying (expr_type); -} - /* Helper for overflow_comparison_p OP0 CODE OP1 is a comparison. Examine the comparison and potentially diff --git a/gcc/tree-vrp.h b/gcc/tree-vrp.h index 3b1d6dc971e..bad50e31aad 100644 --- a/gcc/tree-vrp.h +++ b/gcc/tree-vrp.h @@ -28,11 +28,6 @@ extern int compare_values (tree, tree); extern int compare_values_warnv (tree, tree, bool *); extern int operand_less_p (tree, tree); -void range_fold_unary_expr (value_range *, enum tree_code, tree type, - const value_range *, tree op0_type); -void range_fold_binary_expr (value_range *, enum tree_code, tree type, - const value_range *, const value_range *); - extern enum value_range_kind intersect_range_with_nonzero_bits (enum value_range_kind, wide_int *, wide_int *, const wide_int &, signop); -- 2.40.0