]> git.ipfire.org Git - people/ms/gcc.git/commit
Fix PR 103288, ICE after PHI-OPT, move an assigment when still in use for another bb
authorAndrew Pinski <apinski@marvell.com>
Tue, 16 Nov 2021 23:37:08 +0000 (23:37 +0000)
committerAndrew Pinski <apinski@marvell.com>
Wed, 17 Nov 2021 08:04:14 +0000 (08:04 +0000)
commit1a15a91a0015208eafb797e4de1348c9877fd6d0
tree96e087c5056cc0dbe5634b06222456ebc4e731c8
parentb8ce19bb1a0592051e8f9a4c3252d12ae605b256
Fix PR 103288, ICE after PHI-OPT, move an assigment when still in use for another bb

The problem is r12-5300-gf98f373dd822b35c allows phiopt to recognize more basic blocks
but missed one location where phiopt could move an assignment from the middle block
to the non-middle one.  This patch fixes that.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR tree-optimization/103288

gcc/ChangeLog:

* tree-ssa-phiopt.c (value_replacement): Return early if middle
block has more than one pred.

gcc/testsuite/ChangeLog:

* gcc.c-torture/compile/pr103288-1.c: New test.
gcc/testsuite/gcc.c-torture/compile/pr103288-1.c [new file with mode: 0644]
gcc/tree-ssa-phiopt.c