https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106751

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:ddcaa60983b50378bde1b7e327086fe0ce101795

commit r13-4739-gddcaa60983b50378bde1b7e327086fe0ce101795
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Fri Dec 16 10:19:22 2022 +0100

    loop-invariant: Split preheader edge if the preheader bb ends with jump
[PR106751]

    The RTL loop passes only request simple preheaders, but don't require
    fallthru preheaders, while move_invariant_reg apparently assumes the
    latter, that it can just append instruction(s) to the end of the preheader
    basic block.

    The following patch fixes that by splitting the preheader edge if
    the preheader bb ends with a JUMP_INSN (asm goto in this case).
    Without that we get control flow in the middle of a bb.

    2022-12-16  Jakub Jelinek  <ja...@redhat.com>

            PR rtl-optimization/106751
            * loop-invariant.cc (move_invariant_reg): If preheader bb ends
            with a JUMP_INSN, split the preheader edge and emit invariants
            into the new preheader basic block.

            * gcc.c-torture/compile/pr106751.c: New test.

Reply via email to