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

fold-const.cc: Remove strict_overflow_p from tree_unary_nonnegative

The compiler removes the `strict_overflow_p` flag from `tree_unary_nonnegative` and updates related code in `gimple-fold.cc`.

The compiler removes the strict_overflow_p flag from tree_unary_nonnegative_warnv_p, which is then renamed to tree_unary_nonnegative_p. Related changes are also made in gimple-fold.cc including modification of gimple_assign_nonnegative_warnv_p. Some test cases that checked for warnings are also removed.

In Details

This commit continues the effort to remove the strict_overflow_p flag and associated overflow checks from fold-const.cc. The focus is on tree_unary_nonnegative_warnv_p and its interactions with gimple-fold.cc, with impacts on gimple_assign_nonnegative_warnv_p during Gimple SSA.

For Context

This commit simplifies the non-negative expression checking during constant folding within the compiler. By removing flags and associated logic, the compiler's internal workings are streamlined. The change may impact the specific circumstances under which overflow warnings are generated.

Filed Under: optimizationconstant foldingrefactoringwarningsGimple