]> git.ipfire.org Git - thirdparty/gcc.git/commit
Free dominance info at the beginning of pass_jump_after_combine
authorIlya Leoshkevich <iii@linux.ibm.com>
Fri, 15 Nov 2019 12:55:05 +0000 (12:55 +0000)
committerIlya Leoshkevich <iii@gcc.gnu.org>
Fri, 15 Nov 2019 12:55:05 +0000 (12:55 +0000)
commit50a969f1713d9a8f4706df7d0e786122c1e0f594
tree5df810a743815dcbaaa1afe5a9ed34cf8285395a
parentbb2d60189cf0cc2d8e875cdad243ef3dd6965cb1
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  <iii@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  <iii@linux.ibm.com>

Backport from mainline
PR rtl-optimization/92430
* gcc.dg/pr92430.c: New test (from Arseny Solokha).

From-SVN: r278291
gcc/ChangeLog
gcc/cfgcleanup.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr92430.c [new file with mode: 0644]