This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [3.3 regression?] flag_hosted and back-ends
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: Richard dot Earnshaw at arm dot com, thorpej at wasabisystems dot com, gcc at gcc dot gnu dot org, geoffk at geoffk dot org
- Date: Sat, 15 Mar 2003 14:21:38 +0000
- Subject: Re: [3.3 regression?] flag_hosted and back-ends
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> > My inclination would be to say that taking the address of a nested
> > function should only be supported in a hosted environment, since it
> > requires OS support.
>
>
> Note that in the case of Ada this is a crippling restriction. Of course it is
> not necessary to be able to build Ada on all targets, but GNAT definitely
> requires the ability to take addresses of nested functions (for example,
> all tasking is disabled if this is not the case).
>
> On the other hand, GNAT does not at all need the trampoline mechanism, which
> is only their so that pointers to functions can fit in one word, and one of
> the modifications that is quite high up on our list for GNAT improvements
> is to do away with the use of trampolines.
I was thinking specifically of the GCC extension for C in this case, where
a single pointer-to-function value has to be magically expanded into the
address of a function *and* the address of a closure. That pretty much
has to be done with trampolines and trampolines require support from the
OS on modern CPUs.
R.