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

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

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

commit r17-4661-ge77642a6f29d87c48a935ea6da7c26ce3f8747d3
Author: Vladimir N. Makarov <[email protected]>
Date:   Fri Sep 25 10:13:41 2026 -0400

    [PR 127326][LRA]: Fall back to memory when won operand is already a MEM

    The previous fix resolves 'g' operand to memory when no hard register of
    can hold the operand mode, but it only does so when OFFMEMOK is set.  In
    case 'g' OFFMEMOK is set for reg operands only, so an operand which is
    already a MEM never gets marked and stays recorded as GENERAL_REGS.  An
    operand matching it then inherits that class, finds no hard register able
    to hold the mode, and LRA rejects the asm.  Treating won MEM operand the
    same way as an OFFMEMOK one solves the issue.

    gcc/ChangeLog:

            PR rtl-optimization/127326
            * lra-constraints.cc (process_alt_operands): Resolve the operand
            to memory when it is a winning MEM and the value can be held in a
            register.

    gcc/testsuite/ChangeLog:

            PR rtl-optimization/127326
            * gcc.target/i386/pr127326.c (test2): New test.

Reply via email to