public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-250] Remove range_fold_{unary,binary}_expr.
Date: Wed, 26 Apr 2023 08:36:38 +0000 (GMT)	[thread overview]
Message-ID: <20230426083638.855333853826@sourceware.org> (raw)

https://gcc.gnu.org/g:bfd9415761dabcfa3ddef2c78c169ac82702cd00

commit r14-250-gbfd9415761dabcfa3ddef2c78c169ac82702cd00
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Mon Nov 21 01:06:58 2022 +0100

    Remove range_fold_{unary,binary}_expr.
    
    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.

Diff:
---
 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);

                 reply	other threads:[~2023-04-26  8:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230426083638.855333853826@sourceware.org \
    --to=aldyh@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).