Do not clobber signbit when unioning a NAN.
authorAldy Hernandez <aldyh@redhat.com>
Sun, 4 Sep 2022 06:00:02 +0000 (08:00 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Sun, 4 Sep 2022 12:44:10 +0000 (14:44 +0200)
commit8293a9632c46c8f3f9d531c09194aa8738944927
tree030846febc01c08166501311e33357d2b8a75e5b
parent6832dd39d7b5ede0122a27633ef1859ce3d893a6
Do not clobber signbit when unioning a NAN.

When unioning a known NAN and something else, we're dropping the
properties of the NAN, particularly the sign.  This fixes the
oversight.

With this patch, we should be keeping the sign bit up to date, even in
the presence of NANs.

gcc/ChangeLog:

* value-range.cc (frange::union_): Do not drop properties when
unioning a NAN with something else.
(range_tests_signed_zeros): Add tests.
gcc/value-range.cc