[COMMITTED,16/23] Implement operator_bitwise_or for prange.

Message ID 20240504083056.139719-17-aldyh@redhat.com
State New
Headers
Series prange: pointer ranges |

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

Aldy Hernandez May 4, 2024, 8:30 a.m. UTC
  We seem to have a range-op entry for pointer bitwise OR that we've
inherited from the original VRP implementation, but it never gets
used.  If this is not valid gimple, we can safely remove this entry.

gcc/ChangeLog:

	* range-op-mixed.h: Add overloaded declarations for pointer variants.
	* range-op-ptr.cc (operator_bitwise_or::pointers_handled_p): New.
---
 gcc/range-op-mixed.h |  1 +
 gcc/range-op-ptr.cc  | 11 +++++++++++
 2 files changed, 12 insertions(+)
  

Patch

diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h
index 6158fc51f8e..c45aed93567 100644
--- a/gcc/range-op-mixed.h
+++ b/gcc/range-op-mixed.h
@@ -762,6 +762,7 @@  public:
   // Check compatibility of all operands.
   bool operand_check_p (tree t1, tree t2, tree t3) const final override
     { return range_compatible_p (t1, t2) && range_compatible_p (t1, t3); }
+  bool pointers_handled_p (range_op_dispatch_type, unsigned) const final override;
 protected:
   void wi_fold (irange &r, tree type, const wide_int &lh_lb,
 		const wide_int &lh_ub, const wide_int &rh_lb,
diff --git a/gcc/range-op-ptr.cc b/gcc/range-op-ptr.cc
index 8d5049b1daf..2f2f4bb2b5d 100644
--- a/gcc/range-op-ptr.cc
+++ b/gcc/range-op-ptr.cc
@@ -1219,6 +1219,17 @@  operator_bitwise_and::pointers_handled_p (range_op_dispatch_type type,
     }
 }
 
+bool
+operator_bitwise_or::pointers_handled_p (range_op_dispatch_type,
+					 unsigned) const
+{
+  // NOTE: It looks like we never generate bitwise OR with pointers.
+  // If this is indeed the case, we can move operator_bitwise_or from
+  // range-op-mixed.h to range-op.h.
+  gcc_unreachable ();
+  return false;
+}
+
 // Initialize any pointer operators to the primary table
 
 void