https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110131
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #8) > With https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629128.html we > get: > _34 = (int) _13; > _30 = (unsigned int) _13; > _22 = _30 == 4294967295; > _35 = _22 ? _34 : 0; Maybe: (simplify (cond (eq (convert1?@4 @0) INTEGER_CST@1) (convert2? @0) INTEGER_CST@3) (if (type is a nop_conversion type from @1) (cond! @4 (convert @1) @3))) This should give: _30 = (unsigned int) _13; _22 = _30 == 4294967295; _35 = _22 ? -1 : 0; if (_35 != 5) _35 will -(convert)_22 really. Anyways VRP will notice that _35 can't be 5 and optimize it out.