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

--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Vladimir Makarov
<[email protected]>:

https://gcc.gnu.org/g:893070ea86f16ee59ac6a03adff8dc5aafe4a1d4

commit r14-12244-g893070ea86f16ee59ac6a03adff8dc5aafe4a1d4
Author: Vladimir N. Makarov <[email protected]>
Date:   Fri Jan 9 10:36:29 2026 -0500

    [PR123121, LRA]: Fix wrong rematerialization of insns with several outputs

    LRA in the test case, rematerialize insn with div/mod where div result
    is not used.  Still div result requires ax which is used by different
    pseudos at point of rematerialization and this clobbers the pseudo
    value.  The patch solves the problem by constraining to single set
    insns as we always rematerialize only one pseudo value.  Also there is
    no sense to rematerialize div/mod as usually their latency is more
    than load value from CPU cache.  The patch explicitly excludes such
    insns from rematerialization.

    gcc/ChangeLog:

            PR rtl-optimization/123121
            * lra-remat.cc (bad_for_rematerialization_p): Consider div/mod ops.
            (operand_to_remat): Exclude rematerialization of insns with
            multiple sets.

    gcc/testsuite/ChangeLog:

            PR rtl-optimization/123121
            * gcc.target/i386/pr123121.c: New.

Reply via email to