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

            Bug ID: 89821
           Summary: Get a SIGFPE on a simple test of a kind=real128
                    variable with -ffpe-trap=invalid switch
           Product: gcc
           Version: 7.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: urbanjost at comcast dot net
  Target Milestone: ---

Created attachment 46019
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46019&action=edit
test program that fails if -ffpe-trap=invalid is present on kind=real128 test
but ok on kind=real32 and kind=real64 tests even with switch on

Although there may be IEEE methods that are now preferred with some compilers
the simplified code in the attachment shows a method for testing for a NaN
value that I believe is standard and has worked with 32-bit and 64-bit REAL
variables in more than one programming environment including gfortran(1) with
and without the -ffpe-trap=invalid switch on the gfortran compile. The test
fails on kind=real128 variables (on Cygwin, at least) with the error 

    signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

but the same kind of test works without an error on kind=real32 and kind=real64
variables, as it always has up to this point. I do not think the test is an
arithmetic operation and should be allowed even with the -ffpe-trap=invalid
switch present, as it does for kind=real32 and kind=real128 floating point
variables.  Works without any VISIBLE problem without the -ffpe-trap=invalid
switch.

Reply via email to