https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82578
--- Comment #2 from Andreas Krebbel <krebbel at gcc dot gnu.org> --- I was wondering why CSE doesn't do the right thing here. In fact it would if it would not consider our access registers to be particularly cheap. Access registers are fixed hard regs. Hence, cse considers them to be CHEAP_REGNO's with a cost of 0 making it cheaper than pseudos. Unfortunately it is rather expensive to load an access register into a general purpose reg. Especially if it is a 64 bit value since access regs are only 32bits. Preventing a0 and a1 from being considered cheap ends up with exactly the same code as with the regmove pass. Perhaps CSE should also check register_move_costs when calculating register costs?