diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2019-11-05 03:35:27 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2019-11-05 03:35:27 +0000 |
commit | e65deaff25930557e7de3b2663a7c466a2df04fe (patch) | |
tree | 088cde1ed3a079b1988490b9cb499af8e9343bf7 /gcc | |
parent | 5d2931052190b28e72e45894dfc97245e67bf65e (diff) | |
download | gcc-e65deaff25930557e7de3b2663a7c466a2df04fe.zip gcc-e65deaff25930557e7de3b2663a7c466a2df04fe.tar.gz gcc-e65deaff25930557e7de3b2663a7c466a2df04fe.tar.bz2 |
Use value_range_base::equal_p in value_range_base::operator== so we can handle
symbolics without dying.
From-SVN: r277812
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree-vrp.c | 25 |
2 files changed, 7 insertions, 24 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e726ff6..1c2fff1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-11-05 Aldy Hernandez <aldyh@redhat.com> + + * tree-vrp.c (value_range_base::operator==): Use equal_p to + properly handle symbolics. + (range_compatible_p): Remove. + 2019-11-04 Kamlesh Kumar <kamleshbhalui@gmail.com> * common.opt (-fabi-version): Document =14. diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 452895b..a6d44e9 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 |