comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.A.Leake@nasa.gov>
Subject: Re: Eliminating copying in Gnat
Date: 20 Jan 2003 10:08:19 -0500
Date: 2003-01-20T15:20:42+00:00	[thread overview]
Message-ID: <uiswjamfw.fsf@nasa.gov> (raw)
In-Reply-To: 3e2b7777$0$33930$bed64819@news.gradwell.net

porton@ex-code.com (Victor Porton) writes:

> 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;

Try using a separate specification for Pass, and applying pragma
Inline there:

function Pass(X: T) return T;
pragma Inline(Pass);

function Pass(X: T) return T is
begin
  return X;
end;

I'm not clear if this is the problem.

> If T is a controlled type, it calls Adjust 3(!) times even if I
> compile with optimization ("-O3 -gnatN").

Post complete code that demonstrates this; maybe I'll have other
suggestions. 

> It is in Gnat-3.14p. May be it was fixed in Gnat-3.2/3.15p?

I can test with Gnat 3.15p that if I have complete code.

-- 
-- Stephe



  parent reply	other threads:[~2003-01-20 15:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-20  4:12 Eliminating copying in Gnat Victor Porton
2003-01-20 14:57 ` Damien CARBONNE
2003-01-20 15:03   ` Lutz Donnerhacke
2003-01-20 18:34   ` Martin Krischik
2003-01-20 15:08 ` Stephen Leake [this message]
2003-01-20 21:27 ` Victor Porton
2003-01-21 12:35   ` Georg Bauhaus
2003-01-21 19:21     ` Robert A Duff
2003-01-21 14:52   ` Stephen Leake
2003-01-21 18:49   ` Martin Krischik
2003-01-21 13:10 ` Victor Porton
2003-01-21 18:40 ` Victor Porton
2003-01-21 20:54 ` Victor Porton
  -- strict thread matches above, loose matches on Subject: below --
2003-01-21 13:31 Grein, Christoph
2003-01-21 18:54 ` Randy Brukardt
2003-01-21 19:02 ` 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