https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118948
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Simple fix: diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc index 47492575d00..8867540243b 100644 --- a/gcc/fold-const.cc +++ b/gcc/fold-const.cc @@ -15224,7 +15224,7 @@ bool tree_expr_nonnegative_warnv_p (tree t, bool *strict_overflow_p, int depth) { enum tree_code code; - if (t == error_mark_node) + if (error_operand_p (t)) return false; code = TREE_CODE (t);