https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114666
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note the other pattern which uses logical_inverted_value where it depends on the type does: /* -(type)!A -> (type)A - 1. */ (simplify (negate (convert?:s (logical_inverted_value:s @0))) (if (INTEGRAL_TYPE_P (type) && TREE_CODE (type) != BOOLEAN_TYPE && TYPE_PRECISION (type) > 1 && TREE_CODE (@0) == SSA_NAME && ssa_name_has_boolean_range (@0)) (plus (convert:type @0) { build_all_ones_cst (type); }))) But that is ok because of the check of >1 for precision. The other one dealing with cond is a problem there.