https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127085
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Aldy Hernandez <[email protected]>: https://gcc.gnu.org/g:f4860ebc2facb3aee7aca12f79ee36183f4deda9 commit r17-3702-gf4860ebc2facb3aee7aca12f79ee36183f4deda9 Author: Aldy Hernandez <[email protected]> Date: Wed Aug 26 18:33:19 2026 +0000 phiopt: let cond replication change the loop structure [PR127085] Per Richi's suggestion in the PR, making an irreducible region reducible is a good thing, so instead of preventing it just let loop fixup discover the new loop: set LOOPS_NEED_FIXUP when we changed the CFG, and drop preserves_loop_structure_p in favor of never duplicating a loop header. Tested on ppc64le Linux. PR tree-optimization/127085 gcc/ChangeLog: * tree-ssa-phiopt.cc (preserves_loop_structure_p): Remove. (replicate_cond_into_pred): Do not call it. (replicate_conds_over_phis): Never duplicate loop headers; do not mark back edges; set LOOPS_NEED_FIXUP when the CFG changed. gcc/testsuite/ChangeLog: * gcc.dg/torture/pr127085.c: New test.
