comp.lang.ada
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
Subject: Re: How do I disable elaboration code on this
Date: Thu, 14 Apr 2011 21:19:35 +0200
Date: 2011-04-14T21:19:35+02:00	[thread overview]
Message-ID: <87vcygtzco.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: 6bca8b26-152f-482c-95c0-1abf88b6b29b@a26g2000vbo.googlegroups.com

* Lucretia:

> The problem has nothing to do with the linker, I'm using binutils and
> gnat that I'e built myself. The problem is that GNAT is generating
> elaboration code where it is not allowed, i.e. code that 1)
> initialises  the array to 0 and 2) code that the copies function
> addresses into the array.

I believe that this is simply a missed optimization opportunity in
GNAT.  There have been some changes to increase the number of cases
where initialization can be preelaborated, but this particular area
has not been covered so far.

As for workarounds, using an .S file which allocates the object at the
right address and initializes it seems to be the best way to deal with
this issue at present.  Or you could use a C file and a section
attribute.  C treats pointers to function designators as constant
expressions, but there does not seem to be a C extension which allows
one to specify the address of an object.



  parent reply	other threads:[~2011-04-14 19:19 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-09 13:58 How do I disable elaboration code on this Lucretia
2011-04-09 16:57 ` Jeffrey Carter
2011-04-09 17:01   ` Simon Wright
2011-04-09 17:44     ` Ludovic Brenta
2011-04-09 19:19       ` Simon Wright
2011-04-09 19:32         ` Jeffrey Carter
2011-04-10  9:06           ` Lucretia
2011-04-10  9:31             ` Simon Wright
2011-04-09 19:35         ` Ludovic Brenta
2011-04-09 22:05           ` Simon Wright
2011-04-10  5:39             ` Simon Wright
2011-04-10 17:20   ` Lucretia
2011-04-10 20:12     ` Jeffrey Carter
2011-04-10 20:47     ` Georg Bauhaus
2011-04-10 21:19       ` Lucretia
2011-04-11  5:08         ` Lucretia
2011-04-11  6:28           ` Simon Wright
2011-04-11  8:54             ` Lucretia
2011-04-11 10:10               ` Simon Wright
2011-04-11 11:59                 ` Simon Clubley
2011-04-11 18:30                   ` Simon Wright
2011-04-11 19:12                     ` Simon Wright
2011-04-11 19:50                       ` Simon Wright
2011-04-11 21:40                       ` Lucretia
2011-04-11 23:12                         ` Lucretia
2011-04-11 23:16                           ` Lucretia
2011-04-11 23:31                           ` Lucretia
2011-04-12  5:22                             ` Simon Wright
2011-04-12 17:07                             ` Simon Clubley
2011-04-13 16:53                       ` Simon Wright
2011-04-15  8:38                       ` Simon Wright
2011-04-11 23:08                   ` Lucretia
2011-04-12 11:50                     ` Simon Clubley
2011-04-12 16:48                       ` Lucretia
2011-04-11 11:19               ` Georg Bauhaus
2011-04-11 13:50                 ` Simon Wright
2011-04-14 19:19               ` Florian Weimer [this message]
2011-04-10 16:34 ` Rolf
replies disabled

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