Do not specify NAN sign in frange::set_nonnegative.
authorAldy Hernandez <aldyh@redhat.com>
Thu, 10 Nov 2022 13:29:13 +0000 (14:29 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Thu, 10 Nov 2022 15:41:25 +0000 (16:41 +0100)
commitb4fc06d8c9091166a7404ca1dbeb7c197263de94
tree81fe2936ccae9c944a4d12ab44fd575a7b838fcc
parentf1b76811f2c3773e8cabcc07932bf13e82e264db
Do not specify NAN sign in frange::set_nonnegative.

After further reading of the IEEE 754 standard, it has become clear
that there are no guarantees with regards to the sign of a NAN when it
comes to any operation other than copy, copysign, abs, and negate.

Currently, set_nonnegative() is only used in one place in ranger
applicable to floating point values, when expanding unknown calls.
Since we already specially handle copy, copysign, abs, and negate, all
the calls to set_nonnegative() must be NAN-sign agnostic.

The cleanest solution is to leave the sign unspecificied in
frange::set_nonnegative().  Any special case, must be handled by the
caller.

gcc/ChangeLog:

* value-range.cc (frange::set_nonnegative): Remove NAN sign handling.
(range_tests_signed_zeros): Adjust test.
gcc/value-range.cc