https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112514
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Trying 2023-11-14 Jakub Jelinek <ja...@redhat.com> * config/i386/i386.md (<insn><dwi>3_doubleword_lowpart): Move operands[1] aka low part of input rather than operands[3] aka high part of input to output if not the same register. --- gcc/config/i386/i386.md.jj 2023-11-14 08:10:18.932549803 +0100 +++ gcc/config/i386/i386.md 2023-11-14 09:31:05.565019207 +0100 @@ -14825,8 +14825,8 @@ (define_insn_and_split "<insn><dwi>3_dou { split_double_mode (<DWI>mode, &operands[1], 1, &operands[1], &operands[3]); operands[4] = GEN_INT ((<MODE_SIZE> * BITS_PER_UNIT) - INTVAL (operands[2])); - if (!rtx_equal_p (operands[0], operands[3])) - emit_move_insn (operands[0], operands[3]); + if (!rtx_equal_p (operands[0], operands[1])) + emit_move_insn (operands[0], operands[1]); }) (define_insn "x86_64_shrd" now if it fixes this.