https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25112
Jeffrey A. Law <law at redhat dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |law at redhat dot com --- Comment #2 from Jeffrey A. Law <law at redhat dot com> --- Note that due to the 2-address nature of the m68k, this transformation is only valid when both registers die. We need the register holding the immediate to die because the register will no longer be holding that immediate. We need the register we're comparing against the immediate to die because we're going to change its value. Finally the register we're comparing against the immediate must be a data register otherwise addq/subq will not set the condition codes. It essentially needs to be a 3 insn -> 3 insn peephole2. The key realization is that we're going to depend on test elimination in final to eliminate the comparison. The peep2 just makes it painfully obvious to final how to do that. Patch nearly ready...