https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110176
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Fre turns: b.2_4 = b; _5 = b.2_4 == 0; _6 = (int) _5; _7 = _6 <= i_19; _8 = (int) _7; b = _8; Into: b.2_4 = b; _5 = b.2_4 == 0; _6 = (int) _5; b = 1; Which is wrong as _6 <= -1 is always 0. (simplify (cmp (convert@0 @00) (convert?@1 @10)) ... tree min = lower_bound_in_type (TREE_TYPE (@10), TREE_TYPE (@00)); tree max = upper_bound_in_type (TREE_TYPE (@10), TREE_TYPE (@00)); bool above = integer_nonzerop (const_binop (LT_EXPR, type, max, @10)); bool below = integer_nonzerop (const_binop (LT_EXPR, type, @10, min)); ... (if (above || below) ... { constant_boolean_node (above ? true : false, type); }