Hi, This is the first part of a three-patch series to fix PR 82207 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82207), making gfortran handle signaling NaNs. This part fixes the library code implementing IEEE_CLASS, by using the issignaling macro (from TS 18661-1:2014) to check whether a NaN is signalling.
The patch comes with a testcase, conditional on issignaling support (which will therefore run on glibc targets), which uses C built-ins to generate signaling NaNs and checks in Fortran code that they are classified and behave as expected. Once this is in, the next two parts are: - Add support for generating signaling NaNs in IEEE_VALUE, which is a longer patch because it requires moving the IEEE_VALUE library code from Fortran to C (but will be much more efficient and correct than the current implementation). - Provide a fallback implementation of issignaling on targets that don’t have it. Bootstrapped and regtested on x86_64-pc-gnu-linux. OK to commit? FX
0001-Fortran-Allow-IEEE_CLASS-to-identify-signaling-NaNs.patch
Description: Binary data