]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Implement operator_bitwise_or for prange.
authorAldy Hernandez <aldyh@redhat.com>
Wed, 20 Mar 2024 09:29:50 +0000 (10:29 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Sat, 4 May 2024 08:25:51 +0000 (10:25 +0200)
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
gcc/range-op-ptr.cc

index 6158fc51f8e478ecc65cc8042577cd7d169e7f19..c45aed9356744d6a083cdb640c3ca8a2d30c7df0 100644 (file)
@@ -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,
index 8d5049b1daf8a5a98e5e5d5e809fdc61a2724815..2f2f4bb2b5d74abdddbb9f5b2b594f0367592608 100644 (file)
@@ -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