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] |

*From*: Fergus Henderson <fjh at cs dot mu dot oz dot au>*To*: Brad Lucier <lucier at math dot purdue dot edu>*Cc*: Toon Moene <toon at moene dot indiv dot nluug dot nl>, gcc-patches at gcc dot gnu dot org*Date*: Sun, 4 Aug 2002 12:12:22 +1000*Subject*: Re: # Re: [RFD] -ffinite-math-only.*References*: <3D4AE4C3.678D58D9@moene.indiv.nluug.nl> <200208040034.g740YcN26905@banach.math.purdue.edu>

+ @cindex -fno-finite-math-only option + @cindex options, -fno-finite-math-only + @item -fno-finite-math-only + 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*. I don't see how the option could possibly be useful if Fortran code is still not allowed to produce Infs or NaNs, since almost all operations on Infs or NaNs will result in another Inf or NaN being produced. OK, there are some exceptions, e.g. 1.0 / Inf = 0.0, but I still don't see the point of a mode in which code is allowed to use NaNs or Infs but is not allowed to produce them. While I don't really care much about whether -ffinite-math-only is the default or not, I do think it is very unfriendly to not support NaNs or Infs even when the user explicitly asks for it. 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. (Also, "..." should be ``...'' in TexInfo.) -- Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit The University of Melbourne | of excellence is a lethal habit" WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.

**Follow-Ups**:**Re: # Re: [RFD] -ffinite-math-only.***From:*Toon Moene

**References**:**Re: # Re: [RFD] -ffinite-math-only.***From:*Toon Moene

**Re: # Re: [RFD] -ffinite-math-only.***From:*Brad Lucier

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |