🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #12258

Re: IEEE arithmetic (Goldberg paper)

#12258
From: jbs
Date: Tue, 25 Jun 1991 22:24
46 lines
2880 bytes
         Dan Prener said:
>I would say that, since the program(s) offered above are, according to
>the language standard, non-deterministic, then they are illegal.
         But any program with floating point arithmetic in it is,
according to the language standard, non-deterministic (since the lang-
uage standard does not specify the floating point model).  Surely you
don't believe all such programs are illegal.
         Preston Briggs quotes Dan Prener:
:>Indeed, the spirit of FORTRAN is, overwhelmingly, that a program
:>whose behavior is changed by optimization is not a legal program.
         and adds:
>A wonderfully concise, quotable statement.
>So much nicer than Shearer's assertion that the optimizer must be broken.
         Isn't it however logically equivalent to my statement:
>I think that if a (legal) program behaves differently when compiled with
>and without optimization that then the compiler is broken.
         I asked
> Do you disagree that it is undesirable for optimization to affect
> a program's behavior?
         Jon Krueger replied:
>Yes.
>It is a good and joyful thing, always and everywhere, for
>compilers to expose broken programs.
>Correct programs can be written in available languages.
>The meaning of such programs does not depend on whether
>compilers apply permissible optimizations.
         My comments:
    1.  I would not buy a compiler from someone who enjoys breaking
user code.
    2.  As I pointed out above the behavior of any Fortran program
with floating point operations is not specified by the standard.  If
you believe optimizers may make any transformation permitted by the
standard then the meaning of any program with floating point opera-
tions may depend on the optimization level.  Hence the above quoted
statement would imply all such programs are not correct.
         In general I am disturbed by the attitude that just because
the fortran standard permits some atrocity (such as evaluating a*x+
a*y as a*(x+y)) it is improper to criticize a compiler for doing it.
In my view the standard represents a least common denominator set of
minimal requirements and any quality compiler will obey a stronger
set of requirements.  In this regard, I am not a language lawyer but
it is my understanding that since the standard says nothing about the
accuracy of intrinsic functions a compiler could replace sin(x) with
0 and cos(x) with 1 and be standard compliant.  Is this the case?
                    James B. Shearer
Technical Details
Message-ID: <9106252305.AA27299@ucbvax.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!WATSON.IBM.COM!jbs

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!WATSON.IBM.COM!jbs
From: jbs@WATSON.IBM.COM
Newsgroups: comp.arch
Subject: Re: IEEE arithmetic (Goldberg paper)
Message-ID: <9106252305.AA27299@ucbvax.Berkeley.EDU>
Date: 25 Jun 91 22:24:25 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Lines: 46