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

fold-const.cc: Remove strict_overflow_p from maybe_canonicalize_comparison

The compiler removes the `strict_overflow_p` flag and `fold_overflow_warning` calls from `maybe_canonicalize_comparison`.

The compiler removes the strict_overflow_p flag from the maybe_canonicalize_comparison functions, along with all related fold_overflow_warning calls. This simplifies the code and potentially changes when overflow warnings are issued.

In Details

This commit refactors fold-const.cc by removing the strict_overflow_p flag from maybe_canonicalize_comparison_1 and maybe_canonicalize_comparison. The associated fold_overflow_warning calls are also eliminated, simplifying the comparison canonicalization process within constant folding.

For Context

During constant folding, the compiler may simplify comparison operations. As part of cleaning up overflow handling, this commit removes the strict_overflow_p flag and related warnings from the maybe_canonicalize_comparison functions, which handle the simplification of comparisons.

Filed Under: optimizationconstant foldingrefactoringwarnings