This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: # Re: [RFD] -ffinite-math-only.


Fergus Henderson wrote:

+ Fortran specifies all arithmetic that can result in a NaN or an
+ infinity as "giving undefined results", therefore the compiler
+ by default operates in a way that assumes no NaNs or +-Inf can
+ be generated.  If you want to use a NaN or an Inf produced by
+ means other than Fortran, use this option to compile your
+ Fortran program.

This wording seems to imply that Fortran code which produces a NaN or Inf
has undefined behaviour *even if -fno-finite-math-only is specified*.
That's not what I meant, but I can see how you can read it that way. `Fortran' in the second sentence means `the Fortran language', not the compiler (i.e., it may include an undefined-behaviour-invoking statement in your Fortran source, or an assembler or C routine that you call from your Fortran source).

So, I suggest that the second sentence be changed to this:

	If your program might generate or use NaNs or infinities,
	then you should use this option.
I agree that this is clearer.  I will change it that way.

(Also, "..." should be ``...'' in TexInfo.)
Thanks for the comments.

--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]