LRA is not able to reload zero_extracted in-out operand with matched input operand in the same way as strict_low_part in-out operand. The patch applies the strict_low_part workaround, where we allow LRA to generate an instruction with non-matched input operand, which is split post reload to the instruction that inserts non-matched input operand to an in-out operand and the instruction that uses matched operand, also to zero_extracted in-out operand case. The generated code from the pr82524.c testcase improves from: movl %esi, %ecx movl %edi, %eax movsbl %ch, %esi addl %esi, %edx movb %dl, %ah to: movl %edi, %eax movl %esi, %ecx movb %ch, %ah addb %dl, %ah The compiler is now also able to handle non-commutative operations: movl %edi, %eax movl %esi, %ecx movb %ch, %ah subb %dl, %ah and unary operations: movl %edi, %eax movl %esi, %edx movb %dh, %ah negb %ah The patch also robustifies split condition of the splitters to ensure that only alternatives with unmatched operands are split. PR target/82524 gcc/ChangeLog: * config/i386/i386.md (*add_1_slp): Split insn only for unmatched operand 0. (*sub_1_slp): Ditto. (*_1_slp): Merge pattern from "*and_1_slp" and "*_1_slp" using any_logic code iterator. Split insn only for unmatched operand 0. (*neg1_slp): Split insn only for unmatched operand 0. (*one_cmpl_1_slp): Ditto. (*ashl3_1_slp): Ditto. (*_1_slp): Ditto. (*_1_slp): Ditto. (*addqi_ext_1): Redefine as define_insn_and_split. Add alternative 1 and split insn after reload for unmatched operand 0. (*qi_ext_2): Merge pattern from "*addqi_ext_2" and "*subqi_ext_2" using plusminus code iterator. Redefine as define_insn_and_split. Add alternative 1 and split insn after reload for unmatched operand 0. (*subqi_ext_1): Redefine as define_insn_and_split. Add alternative 1 and split insn after reload for unmatched operand 0. (*qi_ext_0): Merge pattern from "*andqi_ext_0" and and "*qi_ext_0" using any_logic code iterator. (*qi_ext_1): Merge pattern from "*andqi_ext_1" and "*qi_ext_1" using any_logic code iterator. Redefine as define_insn_and_split. Add alternative 1 and split insn after reload for unmatched operand 0. (*qi_ext_1_cc): Merge pattern from "*andqi_ext_1_cc" and "*xorqi_ext_1_cc" using any_logic code iterator. Redefine as define_insn_and_split. Add alternative 1 and split insn after reload for unmatched operand 0. (*qi_ext_2): Merge pattern from "*andqi_ext_2" and "*qi_ext_2" using any_logic code iterator. Redefine as define_insn_and_split. Add alternative 1 and split insn after reload for unmatched operand 0. (*qi_ext_3): Redefine as define_insn_and_split. Add alternative 1 and split insn after reload for unmatched operand 0. (*negqi_ext_1): Rename from "*negqi_ext_2". Add alternative 1 and split insn after reload for unmatched operand 0. (*one_cmplqi_ext_1): Ditto. (*ashlqi_ext_1): Ditto. (*qi_ext_1): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/pr78904-1.c (test_sub): New test. * gcc.target/i386/pr78904-1a.c (test_sub): Ditto. * gcc.target/i386/pr78904-1b.c (test_sub): Ditto. * gcc.target/i386/pr78904-2.c (test_sub): Ditto. * gcc.target/i386/pr78904-2a.c (test_sub): Ditto. * gcc.target/i386/pr78904-2b.c (test_sub): Ditto. * gcc.target/i386/pr78952-4.c (test_sub): Ditto. * gcc.target/i386/pr82524.c: New test. * gcc.target/i386/pr82524-1.c: New test. * gcc.target/i386/pr82524-2.c: New test. * gcc.target/i386/pr82524-3.c: New test. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Uros.