[c++/cgraph] use cgraph in expand_or_defer_fn

Richard Henderson rth@redhat.com
Thu Sep 11 00:02:00 GMT 2003


On Thu, Sep 11, 2003 at 01:54:57AM +0200, Jan Hubicka wrote:
> The problem I run into was the situation where C++ frontend call
> cgraph_finalize_function that calls hook for determining inlinability that
> calls instantiation of the decl that calls another cgraph_finalize_function.
> I am not quite sure how C++ frontend can keep track of this so the
> static variable looks like best solution for this particular problem.

A static function in the c++ front end handles this: function_depth > 1.
If it isn't happening, then we have a GC problem if nothing else.

> When loop starts we emit function, emit variable and cgraph code puts
> comdat function into the pending list, but we don't call
> cgraph_assemble_pending_functions anymore as C++ fronend does not find
> any other function needing finalize and terminates the loop
> not emitting the last variable.

Indeed, it sounds like a reasonable stop-gap solution until
all of the queueing is handled in one place.

Note that I've also found cases in which
cgraph_assemble_pending_functions itself needs to queue new
functions -- those seen in the callgraph already, just not
emitted.

I hope to post that patch before I go home this evening.

> > When do we do this for -O1 -fno-unit-at-a-time?

Nevermind, I see it now.


r~



More information about the Gcc-patches mailing list