This is the mail archive of the 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] Fix PR tree-optimization/17724


> ----- Forwarded message from Diego Novillo <> -----
> Date: Fri, 08 Oct 2004 19:28:08 -0400
> From: Diego Novillo <>
> To: Jakub Jelinek <>
> Cc: Richard Henderson <>,
>         "" <>
> 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.


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