[tree-ssa] Fix dominator bug

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Wed Jan 7 17:03:00 GMT 2004


Hello,

> Zdenek, are you going to craft a patch for this problem?  This potentially
> breaks the dominator optimizer as well; we have this code in tree-ssa-dom.c:
> 
>       /* We may have made some basic blocks unreachable, remove them.  */
>       cfg_altered |= remove_unreachable_blocks ();
> 
>       /* If the CFG was altered, then recompute the dominator tree.  This
>          is not strictly needed if we only removed unreachable blocks, but
>          may produce better results.  If we threaded jumps, then rebuilding
>          the dominator tree is strictly necessary.  */
>       if (cfg_altered)
>         {
>           cleanup_tree_cfg ();
>           calculate_dominance_info (CDI_DOMINATORS);
>         }
> 
> But the "calculate_dominance_info (CDI_DOMINATORS);" call immediately
> returns because it thinks that the dominance info is up-to-date.

no it won't.  If cfg_altered is true, we have altered cfg somewhere
(removed or threaded some edge), so the dominators are marked as at most
conservatively valid.

Zdenek



More information about the Gcc-patches mailing list