https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68841
ktkachov at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |ktkachov at gcc dot gnu.org --- Comment #7 from ktkachov at gcc dot gnu.org --- Hmm, looking at it again, the if-converted sequence: (insn 22 21 73 7 (set (reg:CCGC 17 flags) (compare:CCGC (reg/v:SI 88 [ i ]) (const_int 3 [0x3]))) file.c:19 7 {*cmpsi_1} (nil)) (insn 73 22 74 7 (parallel [ (set (reg:SI 94) (ashift:SI (reg/v:SI 88 [ i ]) (const_int 1 [0x1]))) (clobber (reg:CC 17 flags)) ]) zdenek.c:20 525 {*ashlsi3_1} (nil)) (insn 74 73 75 7 (set (reg/v:SI 93 [ k ]) (eq:SI (reg:CCGC 17 flags) (const_int 0 [0]))) file.c:20 626 {*setcc_si_1_movzbl} (nil)) seems invalid since between the comparison and the use of the CC reg insn73 clobbers it. Presumably that's why the comparison is considered dead code. So ifcvt should have done this. I'll have another look at ifcvt