This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Fix dominator bug
Hello,
> > > > Which reminds me, have you seen any compile-time
> > > > regressions
> > > > due to this change, Steven?
> > >
> > > Only dead code removal is transformation I can think of that would work
> > > with this code without any other dominance tree manipulation.
> > > But dead basic blocks can't be in the dminator tree anyway (we abort
> > > while building the datastructure)
> >
> > We do not (we have no way of knowing about them, once we throw the basic
> > block away).
>
> I meant that we abort when we attempt to build dominator tree for CFG
> with unreachable basic blocks.
> I would agree that something should happen when basic block is removed
> and it is still in the dominator tree, just I would preffer it to be
> abort instead of silent removal of the block from the tree, since any
> transformation that makes blocks unreachable has to either invalidate
> the dominance or update it in more complex way by hand, so the abort
> would be reminder to do it instead of keeping tree silently
> inconsistent.
There is a verify_dominators call in tree_verify_flow_info, which would
inform you about this. The basic block needs to be removed from the
dominance tree in any case, and doing it separately whenever you remove a
block seems clumsy.
> However since we do check this in verify_flow_info later anyway, I don't
> think this is critical, so I would be happy with the silent removal too.
> (do we notice such a forgotten blocks in verify_flow_info?)
No. I will add the check.
Zdenek