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

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

https://gcc.gnu.org/g:6fc3da8fa2af1d4ee154ea803636eabde358b553

commit r15-6091-g6fc3da8fa2af1d4ee154ea803636eabde358b553
Author: Vladimir N. Makarov <vmaka...@redhat.com>
Date:   Tue Dec 10 12:50:27 2024 -0500

    [PR117946][LRA]: When assigning hard reg use biggest mode to check
ira_prohibited_class_mode_regs

    A pseudo in the PR test case gets hard reg 43 which is x86 r15 (after
    r15, xmm regs go).  The pseudo is of INT_SSE_CLASS and SImode but is
    used in TImode as paradoxical subreg.  r15 in TImode is wrong and does
    not satisfy constraint 'r'.  Therefore LRA creates moves involving the
    pseudo in TImode until the limit of reload insns is achieved.
    Unfortunately x86 hard_regno_mode_ok (as some hooks for other targets)
    says that it is ok to use r15 for TImode pseudo.  Therefore LRA uses
    ira_prohibited_class_mode_regs for such cases but it was checked
    against native pseudo mode.  The patch fixes it by using the biggest
    pseudo mode.

    gcc/ChangeLog:

            PR rtl-optimization/117946
            * lra-assigns.cc: (find_hard_regno_for_1): Use the biggest mode to
            check ira_prohibited_class_mode_regs.

    gcc/testsuite/ChangeLog:

            PR rtl-optimization/117946
            * gcc.target/i386/pr117946.c: New.

Reply via email to