https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87871
--- Comment #40 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Segher Boessenkool from comment #39) > On a linux kernel defconfig build it increases code size by 0.567%. > That seems a bit much :-( > > The peephole only recognises > > mov rA,rB > cmp rB,#0 > > and not > > mov rA,rB > cmp rA,#0 Well, changing the peephole2 so that it handles both of the above at the same time shall be quite easy. > > or > > cmp rB,#0 > mov rA,rB And adding a peephole for this case too. The question is what the code size differences would be with those changes (i.e. how often does it help not to have *movsi_compare0 make RA decisions worse vs. how often we actually have those two instructions separated by other insns).