GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/tree-optimization Performance Win

range_of_phi unconditionally unions ranges of all arguments.

GCC's range_of_phi optimization now unconditionally unions ranges of all arguments, improving precision and performance.

The range_of_phi optimization in GCC previously accumulated ranges of equivalences separately and combined them conditionally. This could lead to loss of precision, such as +/- 0.0 ranges, and potential incorrectness. The change simplifies the process by unconditionally unioning the range of each argument, which is also reported to be 0.025% faster.

In Details

The fold_using_range::range_of_phi function in gimple-range-fold.cc computes the range of values a PHI node can take. Previously, it handled equivalences separately. This change modifies it to always union the range of every argument, simplifying the logic and improving precision, particularly for floating-point ranges.

Filed Under: optimizationgcc