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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,8147e9052e4bc0df X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!q33g2000vbt.googlegroups.com!not-for-mail From: Vadim Godunko Newsgroups: comp.lang.ada Subject: Re: -gnatN breakage was: Child vs nested package : efficiency matter Date: Wed, 2 Jun 2010 13:35:29 -0700 (PDT) Organization: http://groups.google.com Message-ID: <829c18a5-c0e6-49ab-97b0-bf4f9222471d@q33g2000vbt.googlegroups.com> References: <37b699c4-da76-4b5f-9074-0aa465af4a19@v12g2000prb.googlegroups.com> <11039f0d-ee37-4c99-ad4b-ab2ed658d553@m21g2000vbr.googlegroups.com> <4c068a95$0$6760$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 188.114.20.227 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1275510929 27805 127.0.0.1 (2 Jun 2010 20:35:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 2 Jun 2010 20:35:29 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q33g2000vbt.googlegroups.com; posting-host=188.114.20.227; posting-account=niG3UgoAAAD7iQ3takWjEn_gw6D9X3ww User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100317 SUSE/3.5.9-0.1.1 Firefox/3.5.9,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:12205 Date: 2010-06-02T13:35:29-07:00 List-Id: On Jun 2, 8:45=A0pm, Georg Bauhaus wrote: > On 02.06.10 16:39, Vadim Godunko wrote: > > > -gnatN is obsolete, you must use pragma Inline/Inline_Always with - > > gnatn instead. > > Does this mean that 3rd party source cannot be > inlined across units unless GNAT specific pragma Inline_Always > is added to these 3rd party sources? No. Use of -gnatn and -O is sufficient to enable inlining of subprograms marked by pragma Inline. But not all subprograms will be inlined but only definitely simple. For example: package P is function Simple (X, Y : Integer) return Integer; pragma Inline (Simple); function Complex (X, Y : Integer) return Integer; pragma Inline (Complex); end P; package body P is function Simple (X, Y : Integer) return Integer is begin return X + Y + 1; end Simple; function Complex (X, Y : Integer) return Integer is begin return X + Y + 1; exception when others =3D> return 0; end Complex; end P; with P; function Test_Simple (X, Y : Integer) return Integer is begin return P.Simple (X, Y); end Test_Simple; with P; function Test_Complex (X, Y : Integer) return Integer is begin return P.Complex (X, Y); end Test_Complex; $ gcc -c -S -O -gnatn test_simple.adb $ gcc -c -S -O -gnatn test_complex.adb >From test_simple.s: _ada_test_simple: leal 1(%rdi,%rsi), %eax ret >From test_complex.s: _ada_test_complex: subq $8, %rsp call p__complex addq $8, %rsp ret