This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR tree-optimization/17724
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: jakub at redhat dot com
- Cc: dnovillo at redhat dot com, rth at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Sat, 9 Oct 2004 11:00:00 +0200
- Subject: Re: [PATCH] Fix PR tree-optimization/17724
- References: <20041009082440.GB22455@atrey.karlin.mff.cuni.cz>
> ----- Forwarded message from Diego Novillo <email@example.com> -----
> Date: Fri, 08 Oct 2004 19:28:08 -0400
> From: Diego Novillo <firstname.lastname@example.org>
> To: Jakub Jelinek <email@example.com>
> Cc: Richard Henderson <firstname.lastname@example.org>,
> "email@example.com" <firstname.lastname@example.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.