]> git.ipfire.org Git - thirdparty/gcc.git/commit
Cleanups to frange.
authorAldy Hernandez <aldyh@redhat.com>
Sun, 31 Jul 2022 11:43:36 +0000 (13:43 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 1 Aug 2022 06:16:03 +0000 (08:16 +0200)
commit3f05605364f6f17b84842a8a5960d465b4448bae
treef74fe9fd71c1f3bf256bd602b38066909f26ba26
parent7e029e067d81f714419cd196fdd506b06881e0c9
Cleanups to frange.

These are some assorted cleanups to the frange class to make it easier
to drop in an implementation with FP endpoints:

* frange::set() had some asserts limiting the type of arguments
  passed.  There's no reason why we can't handle all the variants.
  Worse comes to worse, we can always return a VARYING which is
  conservative and correct.

* frange::normalize_kind() now returns a boolean that can be used in
  union and intersection to indicate that the range changed.

* Implement vrp_val_max and vrp_val_min for floats.  Also, move them
  earlier in the header file so frange can use them.

Tested on x86-64 Linux.

gcc/ChangeLog:

* value-range.cc (tree_compare): New.
(frange::set): Make more general.
(frange::normalize_kind): Cleanup and return bool.
(frange::union_): Use normalize_kind return value.
(frange::intersect): Same.
(frange::verify_range): Remove unnecessary else.
* value-range.h (vrp_val_max): Move before frange class.
(vrp_val_min): Same.
(frange::frange): Remove set to m_type.
gcc/value-range.cc
gcc/value-range.h