https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111566
--- Comment #5 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> --- I had a look at riscv_legitimize_move. It doesn't seem to suffer from quite the same problem as legitimize_move does, but it could if another problem was fixed: riscv_legitimize_move changes the rtl it's passed. That can lead to trouble if this is shared rtl.