https://gcc.gnu.org/g:6b9e640d49138183aaeee67f2dcf3de329318d27
commit r15-157-g6b9e640d49138183aaeee67f2dcf3de329318d27 Author: Aldy Hernandez <al...@redhat.com> Date: Wed Mar 20 10:29:50 2024 +0100 Implement operator_bitwise_or for prange. 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. Diff: --- gcc/range-op-mixed.h | 1 + gcc/range-op-ptr.cc | 11 +++++++++++ 2 files changed, 12 insertions(+) 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