https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100342
--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> --- The problem can be seen in _.pro_and_epilogue pass: Starting with: _.cmpelim 2741: r14:DI=[sp:DI+0x38] ... 368: di:DI=r14:DI ... 613: si:QI=r14:QI ... 2737: bp:DI=r14:DI ... 658: strict_low_part(ax:QI)=bp:QI 2275: dx:DI=si:DI ... 2287: dx:DI=bp:DI 710: dx:DI=bswap(dx:DI) The pass converts: _.pro_and_epilogue rescanning insn with uid = 658. insn 658: replaced reg 6 with 4 verify found no changes in insn with uid = 658. verify found no changes in insn with uid = 2275. deleting insn with uid = 2287. 2741: r14:DI=[sp:DI+0x38] ... 368: di:DI=r14:DI ... 613: si:QI=r14:QI ... 2737: bp:DI=r14:DI ... 658: strict_low_part(ax:QI)=si:QI 2275: dx:DI=si:DI ... 2287: ? 710: dx:DI=bswap(dx:DI) Please note how the optimization removes insn 2287, assuming that rsi holds the whole 64bit value ... Which is not true!