On Fri, Sep 16, 2016 at 08:47:28AM +0200, Richard Biener wrote: > On Fri, 16 Sep 2016, Jakub Jelinek wrote: > > > Hi! > > > > As mentioned in the PR, combiner sometimes calls > > purge_all_dead_edges or purge_dead_edges that can invalidate the dominator > > info if it is computed. Other passes like CSE in that case free the > > dominance info, this patch does the same in the combiner. > > > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > Ok. (I wonder if/why cleanup_cfg (0) doesn't do this then?)
cleanup_cfg only frees it in some cases if it does some kind of changes: /* ??? We probably do this way too often. */ if (current_loops && (changed || (mode & CLEANUP_CFG_CHANGED))) { ... calculate_dominance_info (CDI_DOMINATORS); But here the dominator info gets out of sync earlier, in particular on this testcase in the new_direct_jump_p |= purge_all_dead_edges (); call. Perhaps ideally we should teach all these functions to update the dominator info, but I'm afraid it is a lot of work. Jakub