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,75a8a3664688f227 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-10 15:58:07 PST Path: supernews.google.com!sn-xit-03!supernews.com!nntp.cs.ubc.ca!cyclone.rdc-detw.rr.com!news.mw.mediaone.net!newsxfer.eecs.umich.edu!news.bu.edu!inmet!not-for-mail From: Tucker Taft Newsgroups: comp.lang.ada Subject: Re: Parameter Modes, In In Out and Out Date: Wed, 10 Jan 2001 18:51:22 -0500 Organization: AverStar (formerly Intermetrics) Burlington, MA USA Message-ID: <3A5CF57A.225BC5B5@averstar.com> References: <86itno316m.fsf@acm.org> <93ilsb$jdf$1@nnrp1.deja.com> NNTP-Posting-Host: nebula.burl.averstar.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: inmet2.burl.averstar.com 979170682 25459 141.199.8.77 (10 Jan 2001 23:51:22 GMT) X-Complaints-To: usenet@inmet2.burl.averstar.com NNTP-Posting-Date: 10 Jan 2001 23:51:22 GMT X-Mailer: Mozilla 4.75 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:3888 Date: 2001-01-10T23:51:22+00:00 List-Id: Robert Dewar wrote: > > In article <86itno316m.fsf@acm.org>, > Laurent Guerby wrote: > > > if your compiler uses by copy passing > > for integer, you'll probably get a program_error, because the > > generated code for exiting P will set X with an unitialized > > stack value (the place reserved for the Y value). > > All compilers MUST pass integers by copy, there is no choice. Unless you can prove that passing them by reference would be equivalent, of course. E.g., for [in] out parameters, we generally pass an address of something. Usually that something is a temp which is initialized by copy from the actual parameter. However, if we can prove that it is safe to pass the address of the actual parameter itself (which involves checking for the presence of things like exception handlers, local task units, aliasing, etc.) then we can do so, and thereby avoid the space and copy [in/]out for the temp. -- -Tucker Taft stt@avercom.net http://www.averstar.com/~stt/ Chief Technology Officer, AverCom, Inc. (A Titan Company) Burlington, MA USA (AverCom was formed 1/1/01 from the Commercial Division of AverStar) (http://www.averstar.com/services/ebusiness_applications.html)