https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107172
H.J. Lu <hjl.tools at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hjl.tools at gmail dot com, | |ubizjak at gmail dot com --- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> --- There are: (insn 6 5 17 2 (set (reg:SI 87 [ a_lsm.8 ]) (const_int 2 [0x2])) "x.c":7:7 83 {*movsi_internal} (nil)) ... (insn 62 59 63 2 (parallel [ (set (reg:CCC 17 flags) (ne:CCC (reg:SI 87 [ a_lsm.8 ]) (const_int 0 [0]))) (set (reg:SI 96) (neg:SI (reg:SI 87 [ a_lsm.8 ]))) ]) "x.c":4:7 680 {*negsi_ccc_1} (expr_list:REG_DEAD (reg:SI 87 [ a_lsm.8 ]) (expr_list:REG_UNUSED (reg:SI 96) (nil)))) (insn 63 62 64 2 (parallel [ (set (reg:SI 97) (neg:SI (ltu:SI (reg:CCC 17 flags) (const_int 0 [0])))) (clobber (reg:CC 17 flags)) ]) "x.c":4:7 1258 {*x86_movsicc_0_m1_neg} (expr_list:REG_DEAD (reg:CCC 17 flags) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil)))) Since r87 == 2, combine knows (reg:CCC 17 flags) == 1 and optimizes (ltu:SI (reg:CCC 17 flags) (const_int 0 [0])) as (ltu:SI (const_int 1 [1]) (const_int 0 [0])) to 0.