https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105930
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- thumb1 (which has 16 registers but really only 8 are GPRs) does not have this issue in GCC 12, so I suspect a target specific change caused this.