https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112278
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Richard Sandiford <[email protected]>: https://gcc.gnu.org/g:6e2e0ce6795c863e295eb33559f8dc0500297da3 commit r14-6139-g6e2e0ce6795c863e295eb33559f8dc0500297da3 Author: Richard Sandiford <[email protected]> Date: Tue Dec 5 09:20:55 2023 +0000 lra: Updates of biggest mode for hard regs [PR112278] LRA keeps track of the biggest mode for both hard registers and pseudos. The updates assume that the modes are ordered, i.e. that we can tell whether one is no bigger than the other at compile time. That is (or at least seemed to be) a reasonable restriction for pseudos. But it isn't necessarily so for hard registers, since the uses of hard registers can be logically distinct. The testcase is an example of this. The biggest mode of hard registers is also special for other reasons. As the existing comment says: /* A reg can have a biggest_mode of VOIDmode if it was only ever seen as part of a multi-word register. In that case, just use the reg_rtx mode. Do the same also if the biggest mode was larger than a register or we can not compare the modes. Otherwise, limit the size to that of the biggest access in the function or to the natural mode at least. */ This patch applies the same approach to the updates. gcc/ PR rtl-optimization/112278 * lra-int.h (lra_update_biggest_mode): New function. * lra-coalesce.cc (merge_pseudos): Use it. * lra-lives.cc (process_bb_lives): Likewise. * lra.cc (new_insn_reg): Likewise. gcc/testsuite/ PR rtl-optimization/112278 * gcc.target/aarch64/sve/pr112278.c: New test.
