From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 110292,45b50f14dadfce5b X-Google-Attributes: gid110292,public X-Google-Thread: 102b75,45b50f14dadfce5b X-Google-Attributes: gid102b75,public X-Google-Thread: 1164f8,45b50f14dadfce5b X-Google-Attributes: gid1164f8,public From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) Subject: Re: Final kick at the "Merced Guessing Game" Date: 1997/10/16 Message-ID: <6247fd$ghg$1@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 280894388 References: <61g30t$o2n@news-rocq.inria.fr> <343C34A7.B715A348@tonys.ecology.umn.edu> <3440F805.C98BB347@tonys.ecology.umn.edu> <61tfaa$9fr@sis.cambridge.arm.com> <61uoiu$19e$1@goanna.cs.rmit.edu.au> <3443FAEF.EE62B663@powertelglobal.com> <621dsv$h7p$1@goanna.cs.rmit.edu.au> <3444608B.421F2325@ix.netcom.crud.com> Organization: Comp Sci, RMIT University, Melbourne, Australia. NNTP-Posting-User: ok Newsgroups: comp.sys.intel,comp.arch,comp.sys.dec I wrote: : Another point is that Fortran : applies exactly the same rule to *all* operators: if the compiler : can determine that the *result* of some subcomputation is irrelevant : to the value of the whole, it can delete that subcomputation entirely. "Paul D. DeRocco" replied: >This is certainly true of C++, whose current draft standard >states that the observable effects of running the program must >be the same as if the program were executed as described in the >standard. It's commonly called the "as if" rule. You have drawn a false conclusion. C++ (like C) is entitled to delete a subcomputation if the *EFFECTS* would be the same. Fortran is entitled to delete a subcomputation if the *VALUE* isn't needed, *REGARDLESS OF ANY EFFECTS*. To take a fairly extreme case, consider extern int system(char const *); int i; i = 0*system("rm *"); A C or C++ compiler is unable to delete the call to system(), because it has an *effect* which would not take place if the call were deleted. Whereas, give "the same thing" INTEGER SYSTEM EXTERNAL SYSTEM INTEGER I I = 0*SYSTEM('rm *') to a Fortran compiler, and it is entitled to delete the call to SYSTEM, because the *value* is irrelevant, and the fact that major effects will no longer take place isn't allowed to matter. I do wish people would read more carefully. -- John �neas Byron O'Keefe; 1921/02/04-1997/09/27; TLG,TLTA,BBTNOTL. Richard A. O'Keefe; RMIT Comp.Sci; http://www.cs.rmit.edu.au/%7Eok