From: Aldy Hernandez Date: Tue, 5 Nov 2019 03:35:27 +0000 (+0000) Subject: Use value_range_base::equal_p in value_range_base::operator== so we can handle X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e65deaff25930557e7de3b2663a7c466a2df04fe;p=gcc.git Use value_range_base::equal_p in value_range_base::operator== so we can handle symbolics without dying. From-SVN: r277812 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e726ff6d0a0..1c2fff16295 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-11-05 Aldy Hernandez + + * tree-vrp.c (value_range_base::operator==): Use equal_p to + properly handle symbolics. + (range_compatible_p): Remove. + 2019-11-04 Kamlesh Kumar * common.opt (-fabi-version): Document =14. diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 452895bfc24..a6d44e9dc6d 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -6319,33 +6319,10 @@ value_range_base::intersect (const value_range_base &r) dump_flags |= TDF_DETAILS; } -/* Return TRUE if two types are compatible for range operations. */ - -static bool -range_compatible_p (tree t1, tree t2) -{ - if (POINTER_TYPE_P (t1) && POINTER_TYPE_P (t2)) - return true; - - return types_compatible_p (t1, t2); -} - bool value_range_base::operator== (const value_range_base &r) const { - if (undefined_p ()) - return r.undefined_p (); - - if (num_pairs () != r.num_pairs () - || !range_compatible_p (type (), r.type ())) - return false; - - for (unsigned p = 0; p < num_pairs (); p++) - if (wi::ne_p (lower_bound (p), r.lower_bound (p)) - || wi::ne_p (upper_bound (p), r.upper_bound (p))) - return false; - - return true; + return equal_p (r); } /* Visit all arguments for PHI node PHI that flow through executable