Hi! The fold_all_builtin patch to gimplify results of ccp_fold_builtin uncovered what it seems to be a latent problem - some basic block removals don't recompute dominators of their neighbouring basic blocks. Particularly in one of the attached testcases bb1->bb3, bb1->bb4 and bb3->bb4 are EH edges: +---+ |bb0| +---+ / \ / \ / \ v v +---+ +---+ |bb1|--->|bb2| +---+ +---+ / \ | / \ | / \ | v v | +---+ +---+ | |bb3|-->|bb4| | +---+ +---+ | \ | \ +---+ -------->|bb5| +---+ | --- - strcpy which due to the missing throw () in the testcase can throw is replaced by code that can't throw, thus the EH edges are removed (by tree_purge_dead_eh_edges) and in the end cleanup_tree_cfg kicks in. This in turn calls delete_unreachable_blocks that deletes bb3 and bb4 basic blocks. The problem is that immediate dominator of bb5 before all of this was bb0, but after bb3 and bb4 basic blocks are removed, immediate dominator is bb2; there is nothing that updates the dominator info of bb5 though. Attached are 3 patches, first and third patch were bootstrapped and regtested on i386-redhat-linux, the second one doesn't work but is included for completeness what I tried. The first patch calls free_dominance_info in cleanup_tree_cfg whenever delete_unreachable_blocks deleted some basic blocks. It should be safe, but might be expensive. The second patch tried to recompute dominators in a routine called from delete_basic_block, but apparently some callers of delete_basic_block don't expect the recomputation. The third one recomputes dominators (and post-dominators) of neighbours of unreachable basic blocks after they are deleted by delete_unreachable_blocks. Jakub