We're ICEing when trying to hash a known NAN.  This is unnoticeable
because the only user would be IPA, and even so, it currently doesn't
handle floats.  However, handling floats is a flip of a switch, so
it's best to handle them already.

gcc/ChangeLog:

        * value-range.cc (add_vrange): Handle known NANs.
---
 gcc/value-range.cc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 874a1843ebf..2f37ff3e58e 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -269,14 +269,14 @@ add_vrange (const vrange &v, inchash::hash &hstate,
   if (is_a <frange> (v))
     {
       const frange &r = as_a <frange> (v);
-      if (r.varying_p ())
-       hstate.add_int (VR_VARYING);
+      if (r.known_isnan ())
+       hstate.add_int (VR_NAN);
       else
-       hstate.add_int (VR_RANGE);
-
-      hstate.add_real_value (r.lower_bound ());
-      hstate.add_real_value (r.upper_bound ());
-
+       {
+         hstate.add_int (r.varying_p () ? VR_VARYING : VR_RANGE);
+         hstate.add_real_value (r.lower_bound ());
+         hstate.add_real_value (r.upper_bound ());
+       }
       nan_state nan = r.get_nan_state ();
       hstate.add_int (nan.pos_p ());
       hstate.add_int (nan.neg_p ());
-- 
2.40.1

Reply via email to