floating point exception calling cpu_time()

Nicolas Bock nicolasbock@gmail.com
Mon Jun 8 23:17:00 GMT 2015


Hi,

the following Fortran program:

$ cat test.F90
program test
  real :: start_time
  call cpu_time(start_time)
  write(*, *) start_time
end program test

results in a floating point exception using gcc-4.8.4:

$ gfortran -O0 -g -ffpe-trap=inexact test.F90 && ./a.out

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

Backtrace for this error:
#0  0x7FF44712C757
#1  0x7FF44712CD5E
#2  0x7FF44665CEEF
#3  0x7FF4471FBD82
#4  0x4008A8 in test at test.F90:3
Floating point exception

It seems strange that this happens, but maybe I did something wrong?
Or is that a known problem?

Thanks already,

nick



More information about the Gcc-help mailing list