https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97532
--- Comment #4 from Vladimir Makarov <vmakarov at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #3) > The IRA dump says: > a2(r189,l0) costs: AREG:2000,2000 DREG:2000,2000 CREG:26000,-1000 > BREG:2000,2000 SIREG:2000,2000 DIREG:2000,2000 AD_REGS:2000,2000 > CLOBBERED_REGS > :2000,2000 Q_REGS:2000,2000 TLS_GOTBASE_REGS:2000,2000 > GENERAL_REGS:2000,2000 SSE_FIRST_REG:12000,12000 NO_REX_SSE_REGS:12000,12000 > SSE_REGS:12000, > 12000 ALL_SSE_REGS:12000,12000 MMX_REGS:26000,26000 INT_SSE_REGS:26000,26000 > ALL_REGS:424000,424000 MEM:12000,12000 > so the INT_SSE_REGS cost of 26000 seems might higher than GENERAL_REGS cost. It does not matter what class IRA gives the address reg. LRA should fix this anyway. For usual memory the correct address reg class is checked by legitimate_address_p hook. I guess in this case it is a special memory and its constraint does not check address reg class at all. I believe the bug should be fixed on machine-dependent side of GCC (in constraints and predicates).