https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89081
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2019-01-28 Ever confirmed|0 |1 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- I think the issue is that before RA we have (insn 27 26 30 2 (parallel [ (set (reg:DI 86) (neg:DI (reg/v:DI 84 [ x ]))) (clobber (reg:CC 17 flags)) ]) "t.c":2:26 465 {*negdi2_1} (expr_list:REG_UNUSED (reg:CC 17 flags) (nil))) (insn 30 27 31 2 (set (reg:CCGOC 17 flags) (compare:CCGOC (reg/v:DI 84 [ x ]) (const_int 0 [0]))) "t.c":2:26 8 {*cmpdi_ccno_1} (expr_list:REG_DEAD (reg/v:DI 84 [ x ]) (nil))) (insn 31 30 18 2 (set (reg:DI 83 [ <retval> ]) (if_then_else:DI (lt (reg:CCGOC 17 flags) (const_int 0 [0])) (reg:DI 86) (reg:DI 87))) "t.c":2:26 942 {*movdicc_noc} which means both negated and original value have to be live. So the issue is that cmpelim runs only after reload? Or that combine doesn't try to merge the above or we don't have a suitable pattern.