This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Unit at time compilation mode II
> Jan Hubicka <jh@suse.cz> writes:
>
> >> This is a nifty thing. Can I suggest you look into using this to
> >> disentangle nested-function compilation, so that we never recurse
> >> into c_expand_body from the RTL generator? This would be especially
> >> nice to do for C++ where nested classes (containing functions) are
> >> part of the official language and used relatively frequently.
> >
> > Yes, I plan to continue in that direction (in fact I made code so C
> > nested functions appears to be compilable independnetly), but I would
> > like to make small steps so I didn't boundled that in the initial patch.
>
> Naturally that is the right way to go. Just wanted to put the idea in
> your head, if you hadn't thought of it yourself.
>
> > I would like to switch to callgraph code entirely for C frontend as a
> > next step. I think I can add the logic to not deffer functions when to
> > asked to into it and simply remove the function deffering mechanizm from
> > C frontend entirely.
>
> Sounds good. This could make a number of things easier -- stack reorg
> in the presence of nested functions, for instance; also bottom-up
> inlining, which is difficult to do right now without exponential space
> costs.
Yes, I hope so :)
Implemeting inlining heuristic on the top of callgraph is also dificult,
but much easier than without it.
>
> > For that I need to get obj-C working, that (I hope) will be easy as only
> > virtual method table breaks it right now (so I need some way to explain
> > that function is needed even when it is not extenrally visible or output
> > in data segment as I do right now).
>
> It must be referenced from somewhere... presumably a piece of global
> data that isn't itself obviously used? Perhaps more intelligent
> tracking of the content and uses of global data is in order?
At the moment obj-C work by first generating all functions and tracking
what tables need to be output and then once whole unit is assembled it
output them.
I need to get this to work in kind-of reversed way. I have lowering
frontend hook for this reason. In future I would like AST lowering pass
to sit there that will make such things easy. For objc I guess all I
need is to walk trought the structure, figure out what tables will be
needed and mark functions used by them.
Honza
>
> zw