https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104985
--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Segher Boessenkool from comment #14) > Are you sure this only ever handles pseudos? It is completely broken if not. Yes, I am. All the 4 uses of SUBST_MODE look like: if (regno < FIRST_PSEUDO_REGISTER) newpat_dest = gen_rtx_REG (compare_mode, regno); else { SUBST_MODE (regno_reg_rtx[regno], compare_mode); newpat_dest = regno_reg_rtx[regno]; } > Changing the mode of regno_reg_rtx[...] is always wrong, too. > > Patches 2 and 3 look better, but need a lot more explanation. What does "m" > mean, to start with? m stands for mode. enum undo_kind { UNDO_RTX, UNDO_INT, UNDO_MODE, UNDO_LINKS }; ... union { rtx r; int i; machine_mode m; struct insn_link *l; } old_contents; union { rtx *r; int *i; struct insn_link **l; } where; There are 2 ways to look at those names, one is that they somehow describe their type (but for where what they point to), the other is that it sign the undo_kind (first letter after UNDO_ in lowercase). In the latter case, UNDO_MODE was the only outlier that used where.r instead of where.m. Note, I've posted the patch (last version) to gcc-patches, so patch review can happen there: https://gcc.gnu.org/pipermail/gcc-patches/2022-March/592450.html