------- Comment #27 from rguenth at gcc dot gnu dot org 2006-07-20 08:29 ------- I guess the patch format made it hard to see what the result is. It looks like
nnodes = cgraph_postorder (order); for (i = nnodes - 1; i >= 0; i--) { node = order[i]; if (node->analyzed && node->local.inlinable && (node->needed || node->reachable) && node->callers) inlined |= cgraph_decide_inlining_incrementally (node, true); /* Collect at cgraph roots, which avoids collecting inside cycles. */ if (inlined && !node->callers) { ggc_collect (); inlined = false; } } i.e. inlining is unchanged, only collection is done at a different point. (for pure luck this saves some kB of peak memory usage and compile-time on tramp3d). For the postorder I assumed that inlining for cgraph roots (nodes with no callers) is decided not during deciding for inlining inside a cycle. One could extend this to also collect for cgraph tails, I think, making it !node->callers || !node->callees. Anyway, the patch gcac tested for C and C++ on x86_64-unknown-linux-gnu. And I suspect that if you make 'order' gc allocated you'll loose the ability to effectively collect garbage here. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27882