https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79671
Bernd Edlinger <bernd.edlinger at hotmail dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bernd.edlinger at hotmail dot de --- Comment #12 from Bernd Edlinger <bernd.edlinger at hotmail dot de> --- Hi, I don't know if it helps, but on the assembler level there are only two instructions that need to be moved to make the test case pass: diff -u rh1422456-orig.s rh1422456.s --- rh1422456-orig.s 2017-02-26 22:46:30.068919262 +0100 +++ rh1422456.s 2017-02-26 22:46:56.445920712 +0100 @@ -2046,10 +2046,10 @@ ldr ip, [r4, #100] add lr, sp, #52 movw r3, #:lower16:_ZZN5boost9function4IbRN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERKSB_RNS_6spirit7contextINS_6fusion4consIRSA_NSH_4nil_EEENSH_6vectorIJEEEEERKNSF_2qi10char_classINSF_3tag9char_codeINSS_5spaceENSF_13char_encoding13standard_wideEEEEEE9assign_toINSQ_6detail13parser_binderINSQ_4plusINSQ_10differenceINSR_INST_INSS_5char_ESW_EEEENSQ_12literal_charINSV_8standardELb1ELb0EEEEEEEN4mpl_5bool_ILb1EEEEEEEvT_E13stored_vtable + strb r6, [sp, #293] ldm r5, {r0, r1, r2} cmp ip, #0 movt r3, #:upper16:_ZZN5boost9function4IbRN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERKSB_RNS_6spirit7contextINS_6fusion4consIRSA_NSH_4nil_EEENSH_6vectorIJEEEEERKNSF_2qi10char_classINSF_3tag9char_codeINSS_5spaceENSF_13char_encoding13standard_wideEEEEEE9assign_toINSQ_6detail13parser_binderINSQ_4plusINSQ_10differenceINSR_INST_INSS_5char_ESW_EEEENSQ_12literal_charINSV_8standardELb1ELb0EEEEEEEN4mpl_5bool_ILb1EEEEEEEvT_E13stored_vtable - strb r6, [sp, #293] orr r3, r3, #1 str r7, [sp, #288] str r3, [sp, #48] @@ -2062,10 +2062,10 @@ ldr ip, [r4, #144] add lr, sp, #68 movw r3, #:lower16:_ZZN5boost9function4IbRN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERKSB_RNS_6spirit7contextINS_6fusion4consIRSA_NSH_4nil_EEENSH_6vectorIJEEEEERKNSF_11unused_typeEE9assign_toINSF_2qi6detail13parser_binderINSV_16lexeme_directiveINSV_4plusINSV_10differenceINSV_10char_classINSF_3tag9char_codeINS12_5char_ENSF_13char_encoding13standard_wideEEEEENSV_12literal_charINS15_8standardELb1ELb0EEEEEEEEEN4mpl_5bool_ILb1EEEEEEEvT_E13stored_vtable + strb r6, [sp, #293] ldm r5, {r0, r1, r2} cmp ip, #0 movt r3, #:upper16:_ZZN5boost9function4IbRN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEERKSB_RNS_6spirit7contextINS_6fusion4consIRSA_NSH_4nil_EEENSH_6vectorIJEEEEERKNSF_11unused_typeEE9assign_toINSF_2qi6detail13parser_binderINSV_16lexeme_directiveINSV_4plusINSV_10differenceINSV_10char_classINSF_3tag9char_codeINS12_5char_ENSF_13char_encoding13standard_wideEEEEENSV_12literal_charINS15_8standardELb1ELb0EEEEEEEEEN4mpl_5bool_ILb1EEEEEEEvT_E13stored_vtable - strb r6, [sp, #293] orr r3, r3, #1 str r7, [sp, #288] str r3, [sp, #64] => r5 = sp+292, so strb and ldm overlap. In the reload pass I can find the sp+293 mem rtx: (insn 593 1693 598 67 (parallel [ (set (reg:SI 0 r0) (mem/c:SI (reg/f:SI 5 r5 [680]) [19 MEM[(struct function4D.541978 *)&D.615141].D.542200.functorD.466600+0 S4 A32])) (set (reg:SI 1 r1) (mem/c:SI (plus:SI (reg/f:SI 5 r5 [680]) (const_int 4 [0x4])) [19 MEM[(struct function4D.541978 *)&D.615141].D.542200.functorD.466600+4 S4 A32])) (set (reg:SI 2 r2) (mem/c:SI (plus:SI (reg/f:SI 5 r5 [680]) (const_int 8 [0x8])) [19 MEM[(struct function4D.541978 *)&D.615141].D.542200.functorD.466600+8 S4 A32])) ]) "rh1422456.cc":151826 364 {*ldm3_} (nil)) (insn 598 593 586 67 (set (reg:CC 100 cc) (compare:CC (reg/f:SI 12 ip [orig:181 _251 ] [181]) (const_int 0 [0]))) "rh1422456.cc":151823 196 {*arm_cmpsi_insn} (nil)) (insn 586 598 591 67 (set (mem/c:QI (plus:SI (reg/f:SI 13 sp) (const_int 293 [0x125])) [101 MEM[(struct parser_binderD.572000 *)&D.615141 + 5B]+0 S1 A8]) (reg:QI 6 r6 [493])) 192 {*arm_movqi_insn} (nil)) ... and: (insn 878 1691 883 99 (parallel [ (set (reg:SI 0 r0) (mem/c:SI (reg/f:SI 5 r5 [680]) [19 MEM[(struct function4D.546780 *)&D.615194].D.547000.functorD.466600+0 S4 A32])) (set (reg:SI 1 r1) (mem/c:SI (plus:SI (reg/f:SI 5 r5 [680]) (const_int 4 [0x4])) [19 MEM[(struct function4D.546780 *)&D.615194].D.547000.functorD.466600+4 S4 A32])) (set (reg:SI 2 r2) (mem/c:SI (plus:SI (reg/f:SI 5 r5 [680]) (const_int 8 [0x8])) [19 MEM[(struct function4D.546780 *)&D.615194].D.547000.functorD.466600+8 S4 A32])) ]) "rh1422456.cc":151826 364 {*ldm3_} (nil)) (insn 883 878 871 99 (set (reg:CC 100 cc) (compare:CC (reg/f:SI 12 ip [orig:180 _249 ] [180]) (const_int 0 [0]))) "rh1422456.cc":151823 196 {*arm_cmpsi_insn} (nil)) (insn 871 883 876 99 (set (mem/c:QI (plus:SI (reg/f:SI 13 sp) (const_int 293 [0x125])) [105 MEM[(struct parser_binderD.573224 *)&D.615194 + 5B]+0 S1 A8]) (reg:QI 6 r6 [564])) 192 {*arm_movqi_insn} (nil))