diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-06-12 09:47:43 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-06-12 11:30:51 -0400 |
commit | 0ddc8c7871fdc7748315d9c09fcf29c2607a1077 (patch) | |
tree | 03da205a2791884041e143aed1daced08a63483e /gcc | |
parent | 5410b07a8c3c2ed0e8d6202c898df5ed4cf58494 (diff) | |
download | gcc-0ddc8c7871fdc7748315d9c09fcf29c2607a1077.zip gcc-0ddc8c7871fdc7748315d9c09fcf29c2607a1077.tar.gz gcc-0ddc8c7871fdc7748315d9c09fcf29c2607a1077.tar.bz2 |
Add some overrides.
PR tree-optimization/110205
* range-op-float.cc (range_operator::fold_range): Add default FII
fold routine.
* range-op-mixed.h (class operator_gt): Add missing final overrides.
* range-op.cc (range_op_handler::fold_range): Add RO_FII case.
(operator_lshift ::update_bitmask): Add final override.
(operator_rshift ::update_bitmask): Add final override.
* range-op.h (range_operator::fold_range): Add FII prototype.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/range-op-float.cc | 10 | ||||
-rw-r--r-- | gcc/range-op-mixed.h | 9 | ||||
-rw-r--r-- | gcc/range-op.cc | 10 | ||||
-rw-r--r-- | gcc/range-op.h | 4 |
4 files changed, 27 insertions, 6 deletions
diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 24f2235..f5c0cec 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -158,6 +158,16 @@ range_operator::fold_range (irange &r ATTRIBUTE_UNUSED, } bool +range_operator::fold_range (frange &r ATTRIBUTE_UNUSED, + tree type ATTRIBUTE_UNUSED, + const irange &lh ATTRIBUTE_UNUSED, + const irange &rh ATTRIBUTE_UNUSED, + relation_trio) const +{ + return false; +} + +bool range_operator::op1_range (frange &r ATTRIBUTE_UNUSED, tree type ATTRIBUTE_UNUSED, const frange &lhs ATTRIBUTE_UNUSED, diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h index bdc488b..6944742 100644 --- a/gcc/range-op-mixed.h +++ b/gcc/range-op-mixed.h @@ -239,26 +239,27 @@ public: using range_operator::op1_op2_relation; bool fold_range (irange &r, tree type, const irange &op1, const irange &op2, - relation_trio = TRIO_VARYING) const; + relation_trio = TRIO_VARYING) const final override; bool fold_range (irange &r, tree type, const frange &op1, const frange &op2, relation_trio = TRIO_VARYING) const final override; bool op1_range (irange &r, tree type, const irange &lhs, const irange &op2, - relation_trio = TRIO_VARYING) const; + relation_trio = TRIO_VARYING) const final override; bool op1_range (frange &r, tree type, const irange &lhs, const frange &op2, relation_trio = TRIO_VARYING) const final override; bool op2_range (irange &r, tree type, const irange &lhs, const irange &op1, - relation_trio = TRIO_VARYING) const; + relation_trio = TRIO_VARYING) const final override; bool op2_range (frange &r, tree type, const irange &lhs, const frange &op1, relation_trio = TRIO_VARYING) const final override; relation_kind op1_op2_relation (const irange &lhs) const final override; - void update_bitmask (irange &r, const irange &lh, const irange &rh) const; + void update_bitmask (irange &r, const irange &lh, + const irange &rh) const final override; }; class operator_ge : public range_operator diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 8a661fd..f0dff53 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -219,6 +219,10 @@ range_op_handler::fold_range (vrange &r, tree type, return m_operator->fold_range (as_a <frange> (r), type, as_a <frange> (lh), as_a <frange> (rh), rel); + case RO_FII: + return m_operator->fold_range (as_a <frange> (r), type, + as_a <irange> (lh), + as_a <irange> (rh), rel); default: return false; } @@ -2401,7 +2405,8 @@ public: tree type, const wide_int &, const wide_int &) const; - void update_bitmask (irange &r, const irange &lh, const irange &rh) const + void update_bitmask (irange &r, const irange &lh, + const irange &rh) const final override { update_known_bitmask (r, LSHIFT_EXPR, lh, rh); } } op_lshift; @@ -2432,7 +2437,8 @@ public: const irange &op1, const irange &op2, relation_kind rel) const; - void update_bitmask (irange &r, const irange &lh, const irange &rh) const + void update_bitmask (irange &r, const irange &lh, + const irange &rh) const final override { update_known_bitmask (r, RSHIFT_EXPR, lh, rh); } } op_rshift; diff --git a/gcc/range-op.h b/gcc/range-op.h index 3602bc4..af94c27 100644 --- a/gcc/range-op.h +++ b/gcc/range-op.h @@ -72,6 +72,10 @@ public: const frange &lh, const frange &rh, relation_trio = TRIO_VARYING) const; + virtual bool fold_range (frange &r, tree type, + const irange &lh, + const irange &rh, + relation_trio = TRIO_VARYING) const; // Return the range for op[12] in the general case. LHS is the range for // the LHS of the expression, OP[12]is the range for the other |