[COMMITTED,2/4] - Remove pointer_min_max_operator.

Message ID cd89ef37-b64a-4361-8f0d-1437c38a252f@redhat.com
State New
Headers
Series [COMMITTED,1/4] - Cleanup pointer_plus_operator. |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply

Commit Message

Andrew MacLeod Oct. 24, 2024, 12:53 p.m. UTC
  Similarly, the class pointer_min_max_operator was used back when it was 
shared with irange.  With prange, these operations are performed via

bool operator_min::fold_range (prange &r, tree type, const prange &op1, 
const prange &op2, relation_trio) const
   and
bool operator_max::fold_range (prange &r, tree type, const prange &op1, 
const prange &op2, relation_trio) const

This patch removes the unused clas to avoid confusion.

Bootstraps on x86_64-pc-linux-gnu with no regressions.  pushed.

Andrew
  

Patch

From b6e18f91e75a28e16b4fa117d8275ab146acbb01 Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <amacleod@redhat.com>
Date: Mon, 21 Oct 2024 18:11:43 -0400
Subject: [PATCH 2/4] Remove pointer_min_max_operator.

The pointer_min_max_operator class was used before the current dispatch
system was created.  These operations have been transferred to
operator_min::fold_range () and operator_max::fold_range () with prange
operands.

This class is no longer used for anything, delete it.

	* range-op-ptr.cc (class pointer_min_max_operator): Remove.
	(pointer_min_max_operator::wi_fold): Remove.
---
 gcc/range-op-ptr.cc | 28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/gcc/range-op-ptr.cc b/gcc/range-op-ptr.cc
index 4f4b2cf6bab..f8ce62d5719 100644
--- a/gcc/range-op-ptr.cc
+++ b/gcc/range-op-ptr.cc
@@ -379,34 +379,6 @@  pointer_plus_operator::op2_range (irange &r, tree type,
   return true;
 }
 
-class pointer_min_max_operator : public range_operator
-{
-public:
-  virtual void wi_fold (irange & r, tree type,
-			const wide_int &lh_lb, const wide_int &lh_ub,
-			const wide_int &rh_lb, const wide_int &rh_ub) const;
-} op_ptr_min_max;
-
-void
-pointer_min_max_operator::wi_fold (irange &r, tree type,
-				   const wide_int &lh_lb,
-				   const wide_int &lh_ub,
-				   const wide_int &rh_lb,
-				   const wide_int &rh_ub) const
-{
-  // For MIN/MAX expressions with pointers, we only care about
-  // nullness.  If both are non null, then the result is nonnull.
-  // If both are null, then the result is null.  Otherwise they
-  // are varying.
-  if (!wi_includes_zero_p (type, lh_lb, lh_ub)
-      && !wi_includes_zero_p (type, rh_lb, rh_ub))
-    r.set_nonzero (type);
-  else if (wi_zero_p (type, lh_lb, lh_ub) && wi_zero_p (type, rh_lb, rh_ub))
-    r.set_zero (type);
-  else
-    r.set_varying (type);
-}
-
 class pointer_and_operator : public range_operator
 {
 public:
-- 
2.45.0