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.


Brad Lucier wrote:

Toon Moene wrote:

No, your mixing "undefined behaviour" with "yields a processor-dependent approximation to". Undefined behaviour in Fortran speak means: The `processor' (compiler+assembler+linker+OS+hardware) can do what it likes with your program, because it just broke the rules.

Actually, I don't think I'm mixing those two things.  I just looked through
the f77 standard and I can't find where dividing by zero, for example,
leads to "undefined behavior".  It may be there, but I can't find it.
http://www.fortran.com/f77_std/rjcnf-6.html#sh-6.6:

Any arithmetic operation whose result is not mathematically defined is prohibited in the execution of an executable program. Examples are dividing by zero and raising a zero-valued primary to a zero-valued or negative valued exponent. Raising a negative-valued primary to a real or double precision power is also prohibited.

You're right. It doesn't say "undefined behaviour", it says: "prohibited". I think that's just as good :-)

Well, I'd say that if people use Fortran 77, they should either (1) know the model of arithmetic it supplies and adhere to that

I don't think that f77 *has* a model of arithmetic precise enough to
"adhere to".
It *is* quite precise in what is prohibited. The operations that produce NaNs or Infinities are prohibited. That means that someone who relies on a Fortran 77 program to do this correctly is relying on an extension of Fortran 77.

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