]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove irange::may_contain_p.
authorAldy Hernandez <aldyh@redhat.com>
Mon, 21 Nov 2022 10:19:34 +0000 (11:19 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Wed, 26 Apr 2023 08:28:12 +0000 (10:28 +0200)
The deprecated irange::may_contain_p method differed from contains_p
in that it could handle symbolics, which no longer exist in VRP.

gcc/ChangeLog:

* value-range.cc (irange::may_contain_p): Remove.
* value-range.h (range_includes_zero_p):  Rewrite may_contain_p
usage with contains_p.
* vr-values.cc (compare_range_with_value): Same.

gcc/value-range.cc
gcc/value-range.h
gcc/vr-values.cc

index 26acba7b04bccde42f24ec38c4838c4d8a14b6e5..6c61bcefd6eebdd5a0d79f9e4f1b46b9fa66661d 100644 (file)
@@ -1475,14 +1475,6 @@ irange::value_inside_range (tree val) const
     return !!cmp2;
 }
 
-/* Return TRUE if it is possible that range contains VAL.  */
-
-bool
-irange::may_contain_p (tree val) const
-{
-  return value_inside_range (val) != 0;
-}
-
 /* Return TRUE if range contains INTEGER_CST.  */
 /* Return 1 if VAL is inside value range.
          0 if VAL is not inside value range.
index d2a275958c85ae10574327a487d62fc17da0698b..929dc551aa22ae97953b8d15d28e46e4911f8fe6 100644 (file)
@@ -173,7 +173,6 @@ public:
   bool constant_p () const;                    // DEPRECATED
   void normalize_symbolics ();                 // DEPRECATED
   void normalize_addresses ();                 // DEPRECATED
-  bool may_contain_p (tree) const;             // DEPRECATED
   bool legacy_verbose_union_ (const class irange *);   // DEPRECATED
   bool legacy_verbose_intersect (const irange *);      // DEPRECATED
 
@@ -828,7 +827,8 @@ range_includes_zero_p (const irange *vr)
   if (vr->varying_p ())
     return true;
 
-  return vr->may_contain_p (build_zero_cst (vr->type ()));
+  tree zero = build_zero_cst (vr->type ());
+  return vr->contains_p (zero);
 }
 
 extern void gt_ggc_mx (vrange *);
index ea4fbd7af6755fea3f081aac24a5cf8323824361..841bcd1acb969e026c6b331d39c7f4c8f9395571 100644 (file)
@@ -375,7 +375,8 @@ compare_range_with_value (enum tree_code comp, const value_range *vr,
        return NULL_TREE;
 
       /* ~[VAL_1, VAL_2] OP VAL is known if VAL_1 <= VAL <= VAL_2.  */
-      if (!vr->may_contain_p (val))
+      bool contains_p = TREE_CODE (val) != INTEGER_CST || vr->contains_p (val);
+      if (!contains_p)
        return (comp == NE_EXPR) ? boolean_true_node : boolean_false_node;
 
       return NULL_TREE;