This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [3.3 regression?] flag_hosted and back-ends


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]