https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118067
--- Comment #8 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:d9835825b3d71bbbb93b3d6669174f4386be2cb1 commit r15-6968-gd9835825b3d71bbbb93b3d6669174f4386be2cb1 Author: Vladimir N. Makarov <vmaka...@redhat.com> Date: Thu Jan 16 12:17:31 2025 -0500 [PR118067][LRA]: Use the right mode to evaluate secondary memory reload In the PR case, LRA made insn alternative costly. It happened because LRA incorrectly found that the alternative needs 2nd memory reload as the wrong mode for targetm.secondary_memory_needed was used. This resulted in LRA cycling as an alternative with mask regs was chosen. The patch fixes the PR and add more debug printing which could be useful in the future for debugging function process_alt_operands. gcc/ChangeLog: PR rtl-optimization/1180167 * lra-constraints.cc (process_alt_operands): Use operand mode not subreg reg mode. Add and improve debugging prints for updating losers. gcc/testsuite/ChangeLog: PR rtl-optimization/118067 * gcc.target/i386/pr118067.c: New.