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-20 07:07:56 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Eliminating copying in Gnat Date: 20 Jan 2003 10:08:19 -0500 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <3e2b7777$0$33930$bed64819@news.gradwell.net> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1043076042 29119 128.183.235.92 (20 Jan 2003 15:20:42 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 20 Jan 2003 15:20:42 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:33241 Date: 2003-01-20T15:20:42+00:00 List-Id: porton@ex-code.com (Victor Porton) writes: > Is it possible to cause Gnat to not do unnecessary copying > when calling this fynction? > > function Pass(X: T) return T is > pragma Inline(Pass); > begin > return X; > end; Try using a separate specification for Pass, and applying pragma Inline there: function Pass(X: T) return T; pragma Inline(Pass); function Pass(X: T) return T is begin return X; end; I'm not clear if this is the problem. > If T is a controlled type, it calls Adjust 3(!) times even if I > compile with optimization ("-O3 -gnatN"). Post complete code that demonstrates this; maybe I'll have other suggestions. > It is in Gnat-3.14p. May be it was fixed in Gnat-3.2/3.15p? I can test with Gnat 3.15p that if I have complete code. -- -- Stephe