From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f0ba82308a594485 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Right of Optimize Eager Evaluation Away Date: 1999/11/29 Message-ID: #1/1 X-Deja-AN: 554470780 Sender: bobduff@world.std.com (Robert A Duff) References: <863dtqfo26.fsf@ppp-173-146.villette.club-internet.fr> <861z9afhgd.fsf@ppp-173-146.villette.club-internet.fr> <38420578.D6692D2E@callnetuk.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1999-11-29T00:00:00+00:00 List-Id: Nick Roberts writes: > Laurent Guerby wrote: > > Is the potential raising of an exception the only language barrier > > here (since as you mention the compiler is free to swap calls > > defeating a class of side effects)? This seams easy to fix (via a > > pragma), if one is interested in keeping the functional aspect of the > > code instead of resorting to statements of course. I don't understand Laurent's question. > I didn't receive Laurent's original post (poor UK feed), so - forgive me > - I must guess at what he was originally suggesting, ... Sorry, Nick -- you guessed wrong. ;-) The original question had to do with a function with two formal parameters. Does 11.6 authorize the compiler to omit the evaluation of one of the *actual* parameters in a call, if it can prove that the value of the formal will never be used. The answer is no. We are assuming the evaluation of the actual parameters produces some externally-visible side-effect. (Yes, of course the compiler can optimize anything it likes, if it can prove it doesn't affect the external effect. But that's not the point here.) - Bob