]> git.ipfire.org Git - thirdparty/gcc.git/commit
Clear NAN when reading back a global range if necessary.
authorAldy Hernandez <aldyh@redhat.com>
Wed, 9 Nov 2022 15:05:08 +0000 (16:05 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Wed, 9 Nov 2022 17:21:08 +0000 (18:21 +0100)
commit4eadbe80060ab6c45193a1a57fac84b035e1c328
tree824657e1545bc358240dc4549c9303e110bb0655
parent8bb3f172d33e319a6c15c4285f820b9f152d990e
Clear NAN when reading back a global range if necessary.

When reading back from the global store, we must clear the NAN bit if
necessary.  The reason it's not happening is because the constructor
sets a NAN by default (when HONOR_NANS).  We must be careful to clear
the NAN bit if the original range didn't have a NAN.

I have commented the reason we use the constructor instead of filling
out the fields by hand, because it wasn't clear at re-reading this
code.

PR 107569/tree-optimization

gcc/ChangeLog:

* value-range-storage.cc (frange_storage_slot::get_frange): Clear
NAN if appropriate.
* value-range.cc (range_tests_floats): New test.
gcc/value-range-storage.cc
gcc/value-range.cc