]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add some overrides.
authorAndrew MacLeod <amacleod@redhat.com>
Mon, 12 Jun 2023 13:47:43 +0000 (09:47 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Mon, 12 Jun 2023 15:30:51 +0000 (11:30 -0400)
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.

gcc/range-op-float.cc
gcc/range-op-mixed.h
gcc/range-op.cc
gcc/range-op.h

index 24f2235884f51158c351c2b64ff3f2b970d45634..f5c0cec75c43f4c2c7c5a4e638ba346b391764f9 100644 (file)
@@ -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,
index bdc488b87542584076e3ce0677cd5742cf734618..6944742ecbc1015fbdb12ffec575382fb788faae 100644 (file)
@@ -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
index 8a661fdb04242710569cacbe9aa81e3d1acd1b61..f0dff53ec1ecc4a50ff7df8f3fef9f32d18bd4b2 100644 (file)
@@ -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;
 
index 3602bc4e123d5886b84e74b07a9471cac30b11cd..af94c2756a74f710aa50aec1ac3b3de5eeb43a8e 100644 (file)
@@ -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