https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113354
--- Comment #4 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:76bc70387d936e3c929368c265ce71e8b239e7b7 commit r14-7248-g76bc70387d936e3c929368c265ce71e8b239e7b7 Author: Vladimir N. Makarov <vmaka...@redhat.com> Date: Mon Jan 15 10:19:39 2024 -0500 [PR113354][LRA]: Fixing LRA failure on building MIPS GCC My recent patch for PR112918 triggered a hidden bug in LRA on MIPS. A pseudo is matched to a register constraint and assigned to a hard registers at the first constraint sub-pass but later it is matched to X constraint. Keeping this pseudo in the register (MD0) prevents to use the same register for another pseudo in the insn and this results in LRA failure. The patch fixes this by spilling the pseudo at the constraint subpass when the chosen alternative constraint not require hard register anymore. gcc/ChangeLog: PR middle-end/113354 * lra-constraints.cc (curr_insn_transform): Spill pseudo only used in the insn if the corresponding operand does not require hard register anymore.