comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: GNAT and register allocation
Date: Sun, 22 Apr 2012 18:43:27 +0200
Date: 2012-04-22T18:43:27+02:00	[thread overview]
Message-ID: <4f94352f$0$6625$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <82r4vhi8v4.fsf@stephe-leake.org>

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.

> 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. 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'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.)

If this procedure adequately describes how to achieve inline control,
then I will find a compiler pragma a little easier.




  reply	other threads:[~2012-04-22 16:43 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 [this message]
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
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