Hello,
Le 10/01/2022 à 18:32, FX via Fortran a écrit :
Hi,
Second 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_VALUE. To do
so, I switched that part of library code from Fortran to C, because in C we
have access to all GCC built-ins related to NaNs/infinities/etc, which is super
useful for generating the right bit patterns (instead of using roundabout ways,
like the previous Fortran implementation, for which I am guilty).
I needed to add to kinds.h the value of TINY for each floating-point (which is
used to produce denormals, by halving TINY).
The patch comes with a testcase, which is still conditional on issignaling
support at this stage (and therefore will run on glibc targets only).
I had to amend the gfortran.dg/ieee/ieee_10.f90 testcase, which produces
signaling NaNs while -ffpe-trap=invalid is set. It passed before, but only by
accident, because we were not actually generating signaling NaNs. I’m not sure
what is the expected behaviour, but the patch does not affect the real
behaviour.
Bootstrapped and regtested on x86_64-pc-gnu-linux. OK to commit?
This looks good to me. Thanks.