This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug tree-optimization/21356] [4.1 Regression] Dominance error after aggressive dead code elimination (cd_dce)
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Daniel Berlin <dberlin at dberlin dot org>
- Cc: law at redhat dot com, gcc-patches at gcc dot gnu dot org, gcc-bugzilla at gcc dot gnu dot org
- Date: Thu, 7 Jul 2005 08:57:10 +0200
- Subject: Re: [Bug tree-optimization/21356] [4.1 Regression] Dominance error after aggressive dead code elimination (cd_dce)
- References: <1120658705.8189.62.camel@linux.site>
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