This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
floating point exception calling cpu_time()
- From: Nicolas Bock <nicolasbock at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 8 Jun 2015 17:16:26 -0600
- Subject: floating point exception calling cpu_time()
- Authentication-results: sourceware.org; auth=none
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