https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68217
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail| |4.1.2, 4.3.5 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Fails with just -O1 as well, --param max-combine-insns=2 "fixes" it, =3 "fails". Thus it's triggered by a 3-insn combine: Trying 9 -> 10: Successfully matched this instruction: (set (reg:CCNO 17 flags) (compare:CCNO (and:DI (reg:DI 91 [ D.1848 ]) (reg:DI 93)) (const_int 0 [0]))) allowing combination of insns 9 and 10 original costs 4 + 4 = 8 Trying 7, 8 -> 10: Successfully matched this instruction: (set (reg:CCZ 17 flags) (compare:CCZ (zero_extract:DI (subreg:DI (reg:SI 87 [ D.1847 ]) 0) (const_int 1 [0x1]) (const_int 31 [0x1f])) (const_int 0 [0]))) Successfully matched this instruction: (set (pc) (if_then_else (eq (reg:CCZ 17 flags) (const_int 0 [0])) (label_ref 15) (pc))) allowing combination of insns 7, 8 and 10 original costs 4 + 3 + 8 = 0 replacement cost 4 Before: (insn 7 6 8 2 (set (reg:DI 91 [ D.1848 ]) (sign_extend:DI (reg:SI 87 [ D.1847 ]))) t.c:5 142 {*extendsidi2_rex64} (expr_list:REG_DEAD (reg:SI 87 [ D.1847 ]) (nil))) (insn 8 7 9 2 (set (reg:DI 93) (const_int -9223372036854775808 [0x8000000000000000])) t.c:5 89 {*movdi_internal} (nil)) (insn 9 8 10 2 (parallel [ (set (reg:DI 92 [ x ]) (and:DI (reg:DI 91 [ D.1848 ]) (reg:DI 93))) (clobber (reg:CC 17 flags)) ]) t.c:5 381 {*anddi_1} (expr_list:REG_DEAD (reg:DI 93) (expr_list:REG_DEAD (reg:DI 91 [ D.1848 ]) (expr_list:REG_UNUSED (reg:CC 17 flags) (expr_list:REG_EQUAL (and:DI (reg:DI 91 [ D.1848 ]) (const_int -9223372036854775808 [0x8000000000000000])) (nil)))))) (insn 10 9 11 2 (set (reg:CCNO 17 flags) (compare:CCNO (reg:DI 92 [ x ]) (const_int 0 [0]))) t.c:5 4 {*cmpdi_ccno_1} (expr_list:REG_DEAD (reg:DI 92 [ x ]) (nil))) After: (note 7 6 8 2 NOTE_INSN_DELETED) (note 8 7 9 2 NOTE_INSN_DELETED) (note 9 8 10 2 NOTE_INSN_DELETED) (insn 10 9 11 2 (set (reg:CCZ 17 flags) (compare:CCZ (zero_extract:DI (subreg:DI (reg:SI 87 [ D.1847 ]) 0) (const_int 1 [0x1]) (const_int 31 [0x1f])) (const_int 0 [0]))) t.c:5 368 {*testqi_ext_3} (expr_list:REG_DEAD (reg:SI 87 [ D.1847 ]) (nil))) The zero-extract is weird and the subreg should be the high-part?