This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
-f[no-]finite-math-only
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: gcc at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Thu, 2 Jul 2009 12:02:51 +0200
- Subject: -f[no-]finite-math-only
Dear all,
some Fortran77 code I inherited gives wrong results if compiled
with '-ffast-math', especially with '-ffinite-math-only' enabled
('-ffast-math -fno-finite-math-only' seems to work).
As '-ffinite-math-only' does "Allow optimizations for floating-point
arithmetic that assume that arguments and results are not NaNs or +-Infs", it
is to assume that the code uses either or both. If so, it's very likely that
this was not intended by the original author.
Any pointers on how to track down these issues in ~25kloc of Fortran77 to
double check what's going on?
Thanks
Daniel
P.S. Not using '-ffast-math' would of course be an option, but knowing that
there might be something fishy going on with NaN/Inf does not improve the
confidence in the application's results ...