Skip to content
Snippets Groups Projects
Commit 3f056053 authored by Aldy Hernandez's avatar Aldy Hernandez
Browse files

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.
parent 7e029e06
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment