------- Comment #4 from kargl at gcc dot gnu dot org 2006-03-16 18:58 ------- It looks like Andrew has found your problem. I will, however, suggest that you reconsider using --fast-math with gfortran. One of my codes works correctly without --fast-math, but it will generate NaN's with it. I have not tracked down the problem, nor have I files a bug report because the code is fairly large and complicated.
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26717