[Bug fortran/107071] gfortran.dg/ieee/modes_1.f90 fails on aarch64-linux

rearnsha at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Sep 30 12:42:16 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107071

--- Comment #8 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to Francois-Xavier Coudert from comment #7)
> @Richard The test in gfortran.dg/ieee/modes_1.f90 is not doing that. It is
> checking that the floating-point modes (rounding mode, underflow mode, and
> halting modes) can be set and restored. It is not actually performing any FP
> operation at all.

This is to do with the trapping, though, isn't it?  The failing test is trying
to test the halting mode setting and restoration.  The code is currently
assuming that because the flag bit exists, it can set and restore it, but
although the bit is defined in the architecture, on some (most) implementations
it's RAZ/WI (read-as-zero, write-ignored).  So the code that assumes this goes
wrong.

I might be slightly on the wrong lines here, but in the glibc fp support we
have

int
support_fpu_trap (int flag)
{
  return support_fpu_flag (flag);
}

So we're immediately assuming that if we have the flag, we can support the
trap.  And of course, support_fpu_flag only tests that the relevant flag bit is
defined, not if the HW supports changing it.


More information about the Gcc-bugs mailing list