This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Enhanced nested functions lowering pass
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>
- Date: Sun, 19 Mar 2006 09:22:33 -0500
- Subject: Re: [PATCH] Enhanced nested functions lowering pass
- References: <200603190010.40372.ebotcazou@adacore.com>
On Sun, 2006-03-19 at 00:10 +0100, Eric Botcazou wrote:
> Hi Richard,
>
> You may recall that I already submitted an equivalent patch last September and
> you rejected it: http://gcc.gnu.org/ml/gcc-patches/2005-09/msg00862.html .
> I'm essentially resubmitting it and asking you to reconsider your position.
>
> The goal is to avoid commiting local variables referenced by nested functions
> to the "nonlocal frame structure" too early because that cannot be undone by
> subsequent passes as the structure is addressable. That would be very useful
> for languages that make heavy use of nested functions like Ada.
>
> You rejected it because this requires conducting reachability analysis during
> the pass and you argued that this doesn't belong there.
I really have to agree with Richard here.
> You suggested to
> either reorder the passes or to export some stuff from the cgraph machinery.
> As for your second suggestion, it would boil down to exporting exactly one
> small function. While that would certainly make sense, tree-nested.c already
> contains a custom tree walking engine tailored to its needs and I don't think
> one small function matters much.
Errr, you haven't added one small function.
Also, you haven't really addressed the issue: cgraph already knows
exactly how to do what your patch below adds, you just want to run that
analysis on your nested functions.
Even if you didn't go that far, At the very least, you could remove
almost all the ni_map, reachable flags, etc, you've added below, and
just use the ones on the cgraph nodes.
That would remove *most* of the patch you've submitted, and only leave
the tree walking portion. That may be more palatable to Richard (though
maybe not. It looks almost exactly like record_reference).