Fix PR 108582: ICE due to PHI-OPT removing a still in use ssa_name.
authorAndrew Pinski <apinski@marvell.com>
Sat, 28 Jan 2023 18:27:08 +0000 (18:27 +0000)
committerAndrew Pinski <apinski@marvell.com>
Mon, 30 Jan 2023 12:45:35 +0000 (12:45 +0000)
commit876b3e0514bc8cb2256c44db56255403bedfa52d
tree3b00ac71475e3b05c1cf524b90bf203c641e3c08
parent7ac3e69e311351b70407d7f87a0169c4d463e57b
Fix PR 108582: ICE due to PHI-OPT removing a still in use ssa_name.

This patch adds a check in match_simplify_replacement to make sure the middlebb
does not have any phi-nodes as we don't currently move those.
This was just a thinko from before.

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

PR tree-optimization/108582

gcc/ChangeLog:

* tree-ssa-phiopt.cc (match_simplify_replacement): Add check
for middlebb to have no phi nodes.

gcc/testsuite/ChangeLog:

* gcc.dg/pr108582-1.c: New test.
gcc/testsuite/gcc.dg/pr108582-1.c [new file with mode: 0644]
gcc/tree-ssa-phiopt.cc