https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92430
--- Comment #8 from iii at gcc dot gnu.org --- Author: iii Date: Fri Nov 15 12:55:05 2019 New Revision: 278291 URL: https://gcc.gnu.org/viewcvs?rev=278291&root=gcc&view=rev Log: Free dominance info at the beginning of pass_jump_after_combine try_forward_edges does not update dominance info, and merge_blocks relies on it being up-to-date. In PR92430 stale dominance info makes merge_blocks produce a loop in the dominator tree, which in turn makes delete_basic_block loop forever. Fix by freeing dominance info at the beginning of cleanup_cfg. Also, since the whole point of this pass is to perform jump threading (other cleanups are not valuable at this point), skip it completely when flag_thread_jumps is not set. gcc/ChangeLog: 2019-11-15 Ilya Leoshkevich <i...@linux.ibm.com> Backport from mainline PR rtl-optimization/92430 * cfgcleanup.c (pass_jump_after_combine::gate): New function. (pass_jump_after_combine::execute): Free dominance info at the beginning. gcc/testsuite/ChangeLog: 2019-11-15 Ilya Leoshkevich <i...@linux.ibm.com> Backport from mainline PR rtl-optimization/92430 * gcc.dg/pr92430.c: New test (from Arseny Solokha). Added: branches/gcc-9-branch/gcc/testsuite/gcc.dg/pr92430.c Modified: branches/gcc-9-branch/gcc/ChangeLog branches/gcc-9-branch/gcc/cfgcleanup.c branches/gcc-9-branch/gcc/testsuite/ChangeLog