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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,23ade4b42d9cb5f0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-21 11:22:55 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed-east.nntpserver.com!nntpserver.com!newshosting.com!news-xfer2.atl.newshosting.com!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: Eliminating copying in Gnat User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Tue, 21 Jan 2003 19:21:33 GMT Content-Type: text/plain; charset=us-ascii References: <3e2b7777$0$33930$bed64819@news.gradwell.net> <3e2c8625$0$33922$bed64819@news.gradwell.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Organization: The World Public Access UNIX, Brookline, MA Xref: archiver1.google.com comp.lang.ada:33311 Date: 2003-01-21T19:21:33+00:00 List-Id: Georg Bauhaus writes: > Victor Porton wrote: > : But Adjust is called 3 times :-( > > Are compilers allowed to optimize away an Adjust? Yes. There is an AI about exactly when it can. > Might Adjust not have side effects? Yes, but they better be the sort of side effects that are benign under the allowed optimizations. For example, if the type is doing reference counting, the compiler can optimize away matched pairs of increment/decrement. But if Adjust prints "Hello, world.", the programmer should not expect to see an exact number of "Hello, world."'s printed on the screen. - Bob