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

            Bug ID: 88342
           Summary: Possible bug with IEEE_POSITIVE_INF and
                    -ffpe-trap=overflow
           Product: gcc
           Version: 8.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: matthew.thompson at nasa dot gov
  Target Milestone: ---

All,

A colleague of mine encountered an issue with 8.2.0 (but it's also in 7.3.0 at
least). We believe it might be a bug since our reading of the Standard seems to
make it legal.

Namely if this program:

PROGRAM test
   USE, INTRINSIC :: ieee_arithmetic
   IMPLICIT NONE
   REAL :: inf
   inf = IEEE_VALUE(inf,  IEEE_POSITIVE_INF)
END PROGRAM test

is compiled with -ffpe-trap=overflow the code FPEs:

(998) $ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/ford1/local/gcc/gcc-8.2.0/libexec/gcc/x86_64-pc-linux-gnu/8.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-8.2.0/configure --prefix=/ford1/local/gcc/gcc-8.2.0
--disable-multilib
Thread model: posix
gcc version 8.2.0 (GCC) 
(999) $ gfortran -ffpe-trap=overflow ./test.F90
(1000) $ ./a.out 

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

Backtrace for this error:
#0  0x2aab63d5427f in ???
#1  0x2aab63387d60 in __ieee_arithmetic_MOD_ieee_value_4
        at ../../../gcc-8.2.0/libgfortran/ieee/ieee_arithmetic.F90:892
#2  0x400770 in ???
#3  0x4007c3 in ???
#4  0x2aab63d403d4 in ???
#5  0x400698 in ???
#6  0xffffffffffffffff in ???
Floating exception (core dumped)

Reply via email to