[Bug tree-optimization/21356] [4.1 Regression] Dominance error after aggressive dead code elimination (cd_dce)

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Thu Jul 7 06:57:00 GMT 2005


Hello,

> On Tue, 2005-07-05 at 23:29 -0600, Jeffrey A Law wrote:
> > DCE in aggressive mode sometimes is able to remove control structures
> > and thus edge from the CFG.  Sometimes removal of edges from the CFG
> > changes the dominator tree, but we make no attempt to actually keep
> > the dominators up-to-date.
> > 
> > In this testcase failure to keep the dominators up-to-date leads to
> > a checking failure.  This is trivially addressed by arranging for the
> > dominators to be recomputed if we remove edges from the CFG.  An
> > enterprising individual might be able to incrementally update the
> > dominators,
> 
> Uh, we have code to incrementally update the dominators.
> Just use iterate_fix_dominators 

note however that to use it you must precisely know the set of basic
blocks whose dominators may change (which may or may not be the case
with CDDCE, I haven't thought about it), and the set should rather be
small -- iterate_fix_dominators is O(n^3) in the size of the set.

All in all, if the changes to cfg are indeed rare (which they should be,
given that the problem remained unnoticed so far), just having the
dominators to be recomputed is much easier and safer.

Zdenek



More information about the Gcc-patches mailing list