------- Comment #6 from denis_scherbakov at yahoo dot com 2009-09-11 18:38 ------- By saying "works" I mean that on my system program with
"real, volatile :: a" returns nonzero result. This is correct, because 80-bit floating point gets truncated to 64-bit and then loaded again into FPU. "double precision, volatile :: a" returns zero result. It means that variable "a" stays in FPU registers. I am not sure about your code, but when I compile both versions of a sample program on my machine "real, volatile" is stored and then fetched again, "double precision, volatile" stays in FPU. By the way. A ran your program and got the same wrong result: u...@localhost ~ $ gfortran -std=f2003 -O2 test.F95 -o test-F95 u...@localhost ~ $ ./test-F95 0.1 0.1 0.1 0.1 0.0000000000000000 1.00000007E-02 0.0 means that "double precision" stayed in FPU registers instead of being saved. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41335