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,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-19 20:13:44 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Mon, 20 Jan 2003 09:12:55 +0500 Organization: Extreme Code Software (http://ex-code.com) Subject: Eliminating copying in Gnat Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii X-URL: http://www.ex-code.com/ Message-ID: <3e2b7777$0$33930$bed64819@news.gradwell.net> NNTP-Posting-Date: 20 Jan 2003 04:13:43 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1043036023 news.gradwell.net 33930 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:33224 Date: 2003-01-20T04:13:43+00:00 List-Id: 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; If T is a controlled type, it calls Adjust 3(!) times even if I compile with optimization ("-O3 -gnatN"). I even don't know how to check (well, without reading assembler output) whether copying would be done in the case of non-controlled T. It is in Gnat-3.14p. May be it was fixed in Gnat-3.2/3.15p?