http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51535
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-12-14 07:48:27 UTC --- The issue seems to be related to the excess precision of the x87 math unit. At least, I do not see the issue with x86-86-linux with -m64. I do see it with -m32 but only if I do not use -mfpmath=sse. The reason that it disappears with -O2 is that the NaN assignment is optimized way. >From the dump (-fdump-tree-optimized-lineno): p_h_usstd (real(kind=4) & restrict h) ... [test.f90 : 7:0] sigma = Nan; [test.f90 : 7:0] delta = Nan; The backtrace shows that the exception occurs for line 7.