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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <[email protected]>:

https://gcc.gnu.org/g:1c68b2b4e244dff5f1087c37a68dd891ffae58b4

commit r16-7448-g1c68b2b4e244dff5f1087c37a68dd891ffae58b4
Author: Jakub Jelinek <[email protected]>
Date:   Wed Feb 11 11:34:09 2026 +0100

    cfgexpand: Fix up "=@ccz" etc. outputs on asm goto [PR124056]

    The following testcase is miscompiled, because after_md_seq which is
    what is emitted for "=@cc?" outputs to initialize a pseudo with
    the result is emitted just once, on the asm goto fallthru edge, before
    after_rtl_seq (on that edge that is the correct ordering), but a copy
    of after_rtl_seq is also emitted on the other edges from asm goto, but
    after_md_seq is not.
    So, the pseudo with the flags checking is initialized only in the
    fallthru case and not when asm goto is left through one of the other
    labels (unless those are degenerate).

    The following patch arranges to emit that sequence duplicated on all the
    edges before after_rtl_seq sequence, by modifying after_rtl_seq so that
    it includes after_md_seq followed by the old after_rtl_seq.

    2026-02-11  Jakub Jelinek  <[email protected]>

            PR middle-end/124056
            * cfgexpand.cc (expand_asm_stmt): If after_md_seq is non-NULL, emit
            it at the start of after_rtl_seq instead of after fallthru_label.

            * gcc.target/i386/pr124056.c: New test.

Reply via email to