From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28538 invoked by alias); 15 Mar 2007 15:35:03 -0000 Received: (qmail 27109 invoked by alias); 15 Mar 2007 15:34:36 -0000 Date: Thu, 15 Mar 2007 15:35:00 -0000 Message-ID: <20070315153436.27108.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/30927] tree-nested creates pointless static chains and trampolines when the callgraph is non-trivial In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "baldrick at free dot fr" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg01401.txt.bz2 ------- Comment #5 from baldrick at free dot fr 2007-03-15 15:34 ------- Subject: Re: tree-nested creates pointless static chains and trampolines when the callgraph is non-trivial > > Bootstraps with all languages including Ada. Does not introduce any new > > testsuite failures. I'd appreciate it if the ACT people could pass it > > through their regression test suite. I don't know if this interacts > > correctly with OMP because I don't understand OMP. > > What would it buy us over the patch I previously posted? If I understand right the two patches do different things. Consider the following example: void X(void) { void D(void) { D(); }; D(); } The nested function is reachable, so presumably your patch doesn't change the behaviour of tree-nested in this case, i.e. D gets a static chain even though it doesn't need one. My patch makes sure that D doesn't get a static chain. It doesn't try to do anything about unreachable functions. In fact I noticed that unreachable functions can generate a pointless "nonlocal frame structure", but decided not to attempt a fix because it seemed much more complicated to do! By the way, I see that you added a hash table for going from the context to the nesting_info. I was too lazy to do that, instead I do a linear list walk to find it. Do you think it matters? Ciao, Duncan. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30927