public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1735] Add some overrides.
@ 2023-06-12 15:33 Andrew Macleod
0 siblings, 0 replies; only message in thread
From: Andrew Macleod @ 2023-06-12 15:33 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:0ddc8c7871fdc7748315d9c09fcf29c2607a1077
commit r14-1735-g0ddc8c7871fdc7748315d9c09fcf29c2607a1077
Author: Andrew MacLeod <amacleod@redhat.com>
Date: Mon Jun 12 09:47:43 2023 -0400
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.
Diff:
---
gcc/range-op-float.cc | 10 ++++++++++
gcc/range-op-mixed.h | 9 +++++----
gcc/range-op.cc | 10 ++++++++--
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 24f2235884f..f5c0cec75c4 100644
--- a/gcc/range-op-float.cc
+++ b/gcc/range-op-float.cc
@@ -157,6 +157,16 @@ range_operator::fold_range (irange &r ATTRIBUTE_UNUSED,
return false;
}
+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,
diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h
index bdc488b8754..6944742ecbc 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 8a661fdb042..f0dff53ec1e 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 3602bc4e123..af94c2756a7 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-12 15:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 15:33 [gcc r14-1735] Add some overrides Andrew Macleod
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).