https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56096
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I think one way to improve the constant forming is during isel if we have condition exec (e.g. arm or ia64) we should transform: _7 = _1 != 0; _8 = (int) _7; _9 = _8 << 3; to: _9 = _1 ? 8 : 0; That will at least fix this part: movne r3, #1 moveq r3, #0 lsls r3, r3, #3 To fix the other part, I don't know ...