From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28588 invoked by alias); 9 Oct 2004 09:00:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 28536 invoked from network); 9 Oct 2004 09:00:01 -0000 Received: from unknown (HELO atrey.karlin.mff.cuni.cz) (195.113.31.123) by sourceware.org with SMTP; 9 Oct 2004 09:00:01 -0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 29025) id 980FC4B4335; Sat, 9 Oct 2004 11:00:00 +0200 (CEST) Date: Sat, 09 Oct 2004 09:23:00 -0000 From: Zdenek Dvorak To: jakub@redhat.com Cc: dnovillo@redhat.com, rth@redhat.com, gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix PR tree-optimization/17724 Message-ID: <20041009090000.GA24787@atrey.karlin.mff.cuni.cz> References: <20041009082440.GB22455@atrey.karlin.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041009082440.GB22455@atrey.karlin.mff.cuni.cz> User-Agent: Mutt/1.5.6i X-SW-Source: 2004-10/txt/msg00817.txt.bz2 Hello, > ----- Forwarded message from Diego Novillo ----- > > Date: Fri, 08 Oct 2004 19:28:08 -0400 > From: Diego Novillo > To: Jakub Jelinek > Cc: Richard Henderson , > "gcc-patches@gcc.gnu.org" > Subject: Re: [PATCH] Fix PR tree-optimization/17724 > > On Thu, 2004-10-07 at 16:04, Jakub Jelinek wrote: > > > The third one recomputes dominators (and post-dominators) of neighbours > > of unreachable basic blocks after they are deleted by > > delete_unreachable_blocks. > > > I like this one. It looks OK and safe, so let's go with it. > > > Thanks. Diego. > > ----- End forwarded message ----- this does not seem to be the right fix to me: 1) Change to delete_unreachable_blocks is not necessary. As long as dominators are set correctly before delete_unreachable_blocks, they are also set correctly after it (since removal of unreachable blocks cannot affect any path from entry to basic block bb, and immediate dominator is determined from exactly these paths). 2) Change in tree_purge_dead_eh_edges also is not OK. tree_purge_dead_eh_edges may remove basically arbitrary edge. After removal of the edge, just locally updating the dominators of the destination of the edge is not sufficient, since also immediate dominators of other blocks may get changed. 3) The attempts to update postdominators are just wasted time, since we do not try to update those anywhere else (making updating of postdominators work would require changes on many more places, and so far it is not needed anywhere). So the real problem for the bug is that tree_purge_dead_eh_edges breaks the information about dominators irrepairably (at least in the current state; it would be of course possible to write code to update dominators after edge removal incrementally, but it would be relatively complicated and I am not entirely sure it would pay up in the compile time). The right fix is simply to call free_dominance_info in tree_purge_dead_eh_edges when the edge is removed. Zdenek