This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Two other optimization questions.
toon@moene.indiv.nluug.nl (Toon Moene) writes:
> Geert Bosch wrote:
>
> > Open code
> >
> > if (x < 0)
> > throw domain_error;
> > result = sqrt(x);
> >
> > What should actually happen, I think, is that we should allow for
> > builtins to be added by the language front end, and by the target
> > machine.
> >
> > This is what currently is done in GNAT. Actually I do not really
> > see the need for builtin's in the case of GNAT. Full function
> > inlining across different compilation units works fine,
> > and there is no need for special circuitry for language defined
> > functions. (In general the idea of front-end provided overrides
> > for builtin's seems interesting though!)
>
> Hmmm, how do you do function inlining across different compilation units
> ? The only Fortran implementation I'm familiar with that does that is
> SGI's - they postpone interprocedural analysis and optimization until
> link time.
>
> Does GNAT have such a linker ? If so, is it under the GPL (i.e. useable
> to other Front Ends ?
GNAT works with the source code of other modules, so it reparses
the module in question if it finds a Pragma(Inline) directive. This works
because of the Ada95 module model (a little bit similar to java's), where
it is always clear where to find the other module. No linker support needed.
Somewhere on www.gnat.com there is a paper about their source based module
concept, in case you want to know more details.
G++ will have to support something like this soon too, for an efficient
Standard C++ "export" implementation, perhaps based on the existing -frepo
code ?
-Andi
--
This is like TV. I don't like TV.