GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/fold-const.cc

Remove strict_overflow_p from tree_unary_nonzero_warnv_p

The strict_overflow_p flag was removed from tree_unary_nonzero_warnv_p, which was then renamed to tree_unary_nonzero_p.

The strict_overflow_p flag was removed from the tree_unary_nonzero_warnv_p helper function, and the function was subsequently renamed to tree_unary_nonzero_p. This function is called by tree_expr_nonzero_warnv_p, which is part of a broader effort to remove calls to fold_overflow_warning(). The renaming reflects that the function no longer directly handles overflow warnings.

In Details

This commit removes strict_overflow_p from tree_unary_nonzero_warnv_p within fold-const.cc. This function, called by tree_expr_nonzero_warnv_p, determines if a unary expression is non-zero. As the function no longer directly handles overflow warnings, the warnv suffix is dropped. The broader context is deprecating -Wstrict-overflow, which is not immediately obvious from the file itself.

For Context

GCC optimizes code by simplifying constant expressions at compile time. The tree_unary_nonzero_warnv_p function helps determine if a unary expression is non-zero. This commit removes the strict_overflow_p flag, which controlled potential overflow warnings, and renames the function to tree_unary_nonzero_p. The warnv suffix indicated that the function might trigger overflow warnings, which is no longer the case. This is part of a larger effort to deprecate the -Wstrict-overflow compiler flag.

Filed Under: optimizationconstant foldingoverflow