]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/106198 - CFG cleanup vs LC SSA
authorRichard Biener <rguenther@suse.de>
Tue, 5 Jul 2022 12:14:49 +0000 (14:14 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 5 Jul 2022 14:05:59 +0000 (16:05 +0200)
commit07dd0f7ba27d1fe9f0ce5b049ac5735dc5d361ad
tree5cb0dcaf215051b224a42f416a0089db4467ee50
parent1cc08ceb5baa4e4d6ade6de3a82d22d8fc2cc2a0
tree-optimization/106198 - CFG cleanup vs LC SSA

This is another case like PR106182 where for the 2nd testcase in
the bug there are no removed or discovered loops but still changing
loop exits invalidates LC SSA and it is not enough to just scan for
uses in the blocks that changed loop depth.  One might argue that
if we'd include former exit destinations we'd pick up the original
LC SSA use but for virtuals on block merging we'd have propagated
those out (while for regular uses we insert copies).  CFG cleanup
can also be entered with loops needing fixup so any heuristics
based on loop structure are bound to fail.

PR tree-optimization/106198
* tree-cfgcleanup.cc (repair_loop_structures): Always do a
full LC SSA rewrite but only if any blocks changed loop
depth.

* gcc.dg/pr106198.c: New testcase.
gcc/testsuite/gcc.dg/pr106198.c [new file with mode: 0644]
gcc/tree-cfgcleanup.cc