aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2024-03-20 10:29:50 +0100
committerAldy Hernandez <aldyh@redhat.com>2024-05-04 10:25:51 +0200
commit6b9e640d49138183aaeee67f2dcf3de329318d27 (patch)
tree57b2727549ac5be621709c8154b4e3bedbcaacbf
parente58f14916954411628eb122da996383b8c996b57 (diff)
downloadgcc-6b9e640d49138183aaeee67f2dcf3de329318d27.zip
gcc-6b9e640d49138183aaeee67f2dcf3de329318d27.tar.gz
gcc-6b9e640d49138183aaeee67f2dcf3de329318d27.tar.bz2
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.
-rw-r--r--gcc/range-op-mixed.h1
-rw-r--r--gcc/range-op-ptr.cc11
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h
index 6158fc5..c45aed9 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 8d5049b..2f2f4bb 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