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-Thread: 103376,a32653cf595422e6 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.197.193 with SMTP id iw1mr1256720pbc.0.1335270033023; Tue, 24 Apr 2012 05:20:33 -0700 (PDT) Path: r9ni92998pbh.0!nntp.google.com!news2.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: GNAT and register allocation References: <4f9138c2$0$6628$9b4e6d93@newsspool2.arcor-online.net> <4f9145b5$0$6557$9b4e6d93@newsspool4.arcor-online.net> <4f918218$0$6557$9b4e6d93@newsspool4.arcor-online.net> <82r4vhi8v4.fsf@stephe-leake.org> <4f94352f$0$6625$9b4e6d93@newsspool2.arcor-online.net> Date: Tue, 24 Apr 2012 08:21:16 -0400 Message-ID: <82pqaxgw1v.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (windows-nt) Cancel-Lock: sha1:dTAigHLoltVK+a91bqZ3OvX7gwk= MIME-Version: 1.0 X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: cd9214f969a90e029e66114780 X-Received-Bytes: 3155 Content-Type: text/plain; charset=us-ascii Date: 2012-04-24T08:21:16-04:00 List-Id: Georg Bauhaus writes: > On 21.04.12 14:10, Stephen Leake wrote: > >>> I must use one set of options for an entire program in this case. >> >> Why? > > This requirement is likely a fact (external) that we can't change. > We may try one day. Sounds like a bad rule; do they tell you to use C? or to use -O3 instead of -O2? This is a decision that should be left to the people running the Makefiles! >> gpr files give you a way to apply different compilation options to >> different files. There are _lots_ of low-level gcc options controlling >> inline and other optimizations; see gnat user guide, section 3.10. > > Controlling inline expansion with GCC's -f[no]-inline[-*] can > require that the entire program be reorganized. Consider a call chain: > > A > -> B > --> C > ---> D > > I want to specify that D be expanded inline into C, > but also want to prevent C from being expanded into B. > That is, B should actually call C. Right now, the bodies > of B, C, and D are neighbors in the same scope. > > In this case, a possible solution seems to be to arrange > for separate compilation units. Yes. > Specify -fno-inline-functions for the translation of B, and enable > inline expansion for C and D. Is this correct? OR will the "outer" > inline prevention override the "inner"? I don't know; the manual isn't very clear. A little experimentation would tell. > I'm also no sure yet whether or not this arrangement will be possible > using Ada's feature for separate compilation ("separate" keyword), > or whether I would have to make a child package containing C and D. > (IIRC, GNAT uses slightly different rules for subprograms declared > separate in other subprograms than for subprograms declared separate > in (non-generic?) packages.) Right. > If this procedure adequately describes how to achieve inline control, > then I will find a compiler pragma a little easier. I guess you mean 'a pragma I can include in the current source files, that applies to specific subprograms'. Yes, that would be simpler. The command line options have the advantage of being available now :). -- -- Stephe