diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2023-05-24 19:53:53 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2023-05-25 07:24:52 +0200 |
commit | cd64ba5a7265b5733da6b54cf72b726113dd68d8 (patch) | |
tree | 10f9ab9388555825a1342ef9466f38648a6f55f4 | |
parent | c1c564629f3277e6ac79822ad4e1896fc5d9d450 (diff) | |
download | gcc-cd64ba5a7265b5733da6b54cf72b726113dd68d8.zip gcc-cd64ba5a7265b5733da6b54cf72b726113dd68d8.tar.gz gcc-cd64ba5a7265b5733da6b54cf72b726113dd68d8.tar.bz2 |
Hash known NANs correctly for franges.
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.
-rw-r--r-- | gcc/value-range.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 874a184..2f37ff3 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 ()); |