This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Enhanced nested functions lowering pass


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).





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]