http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58779
--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> --- combine pass is converting: (insn 21 20 22 4 (parallel [ (set (reg:SI 73) (minus:SI (reg:SI 64 [ a.2 ]) (reg:SI 59 [ iftmp.3 ]))) (clobber (reg:CC 17 flags)) ]) pr58779.c:8 286 {*subsi_1} (expr_list:REG_DEAD (reg:SI 59 [ iftmp.3 ]) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil)))) (insn 22 21 23 4 (set (reg:CC 17 flags) (compare:CC (reg:SI 64 [ a.2 ]) (reg:SI 73))) pr58779.c:8 6 {*cmpsi_1} (expr_list:REG_DEAD (reg:SI 73) (expr_list:REG_DEAD (reg:SI 64 [ a.2 ]) (nil)))) (jump_insn 23 22 24 4 (set (pc) (if_then_else (ltu (reg:CC 17 flags) (const_int 0 [0])) (label_ref 27) (pc))) pr58779.c:8 596 {*jcc_1} (expr_list:REG_DEAD (reg:CC 17 flags) (expr_list:REG_BR_PROB (const_int 9996 [0x270c]) (nil))) to: (insn 22 21 23 4 (set (reg:CCC 17 flags) (compare:CCC (minus:SI (reg:SI 64 [ a.2 ]) (reg:SI 59 [ iftmp.3 ])) (reg:SI 64 [ a.2 ]))) pr58779.c:8 316 {*subsi3_cconly_overflow} (expr_list:REG_DEAD (reg:SI 59 [ iftmp.3 ]) (expr_list:REG_DEAD (reg:SI 64 [ a.2 ]) (nil)))) (jump_insn 23 22 24 4 (set (pc) (if_then_else (gtu (reg:CCC 17 flags) (const_int 0 [0])) (label_ref 27) (pc))) pr58779.c:8 596 {*jcc_1} (expr_list:REG_DEAD (reg:CC 17 flags) (expr_list:REG_BR_PROB (const_int 9996 [0x270c]) (nil))) To satisfy the *subsi3_cconly_overflow pattern, the operands of the compare are swapped, and this reflects in changing jump insn condition from LTU to GTU. The LTU in CCmode results in "jb" instruction, whereas GTU in CCCmode in unpatched gcc also results in "jb". As Mikael figured out in Comment #2, we should jump on Not-Carry condition here. It looks to me that MINUS overflow checks are NOT modelled correctly. To hide this problem, GTU and LEU conditions operate with inverted flag check, as can be seen in i386.c, put_condition_code: case GTU: if (mode == CCmode) suffix = fp ? "nbe" : "a"; else if (mode == CCCmode) suffix = "b"; ... case LEU: if (mode == CCmode) suffix = "be"; else if (mode == CCCmode) suffix = fp ? "nb" : "ae"; ... As can be seen from the above code, hecks in CCCmode are inverted. So, the solution is simply to remove wrong MINUS overflow checks, as in to-be attached patch.