This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

floating point exception calling cpu_time()


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]