https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104985
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 52695 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52695&action=edit gcc12-pr104985.patch As I can't reproduce, just an untested patch, which will not keep around addresses of regno_reg_rtx array elements, but the regnos. Yet another option would be to make where.m a rtx and save there the REGs.