https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123285
--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:772499fd7e2f9acf28d71dfb3a91d4458531608e commit r16-7687-g772499fd7e2f9acf28d71dfb3a91d4458531608e Author: Andrew Pinski <[email protected]> Date: Tue Jan 27 12:19:13 2026 -0800 aarch64: early-ra: Fix handling of multi-register allocation with clobbers [PR123285] So the problem here is while forming chains, we don't process hard register conflicts (and ABI based ones) for allocnos which are already part of a chain. This means sometimes we allocate a register to a color which might be clobbered over is live range. Processing clobbers for all allocnos don't work while forming a chain does not work as the chain's front allocnos' candidates does not get updated. So we need to the processing of clobbers (and ABI clobbers) before starting to form the chains. Changes since v1: * v2: remove accidental hack which was there just for testing. * v3: Move the copying of the shared part to new earlier loop too. Fix small white space issue. Bootstrappd and tested on aarch64-linux-gnu. PR target/123285 gcc/ChangeLog: * config/aarch64/aarch64-early-ra.cc (early_ra::form_chains): Process clobbers and ABI clobbers before starting to form the chain. gcc/testsuite/ChangeLog: * gcc.target/aarch64/pr123285-1.c: New test. Signed-off-by: Andrew Pinski <[email protected]>
