comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: GNAT and register allocation
Date: Tue, 24 Apr 2012 08:21:16 -0400
Date: 2012-04-24T08:21:16-04:00	[thread overview]
Message-ID: <82pqaxgw1v.fsf@stephe-leake.org> (raw)
In-Reply-To: 4f94352f$0$6625$9b4e6d93@newsspool2.arcor-online.net

Georg Bauhaus <rm.dash-bauhaus@futureapps.de> 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



  parent reply	other threads:[~2012-04-24 12:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 10:21 GNAT and register allocation Georg Bauhaus
2012-04-20 11:17 ` Georg Bauhaus
2012-04-20 13:48   ` Markus Schöpflin
2012-04-20 15:34     ` Georg Bauhaus
2012-04-21 12:10       ` Stephen Leake
2012-04-22 16:43         ` Georg Bauhaus
2012-04-22 17:39           ` Jacob Sparre Andersen
2012-04-22 21:14             ` Georg Bauhaus
2012-04-24 12:24               ` Stephen Leake
2012-04-24 13:27                 ` Georg Bauhaus
2012-04-24 18:40                   ` "gnatchop" and ".gpr" files? (Was: GNAT and register allocation) Jacob Sparre Andersen
2012-04-25 11:51                   ` GNAT and register allocation Stephen Leake
2012-04-25 12:54                     ` Georg Bauhaus
2012-04-26 10:55                       ` Stephen Leake
2012-04-26 17:15                         ` Georg Bauhaus
2012-04-24 12:21           ` Stephen Leake [this message]
2012-04-22 17:30         ` Georg Bauhaus
2012-04-21 15:41       ` Florian Weimer
2012-04-22 16:53         ` Georg Bauhaus
2012-04-22 20:53           ` gautier_niouzes
2012-04-22 21:24             ` Georg Bauhaus
2012-04-23  8:43               ` gautier_niouzes
2012-04-23 16:46                 ` Georg Bauhaus
2012-04-23  9:11               ` gautier_niouzes
2012-04-23 16:47                 ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox