Removes inappropriate frange_drop_infs call.
Corrects floating-point range analysis to avoid incorrectly dropping infinities.
A call to frange_drop_infs was inappropriately added to the range analysis for integer-to-floating-point conversions. This function incorrectly removed positive or negative infinity from floating-point ranges, even when such values could legitimately result from conversions, especially with types like _Float16 or large _BitInt values. The fix removes this call, allowing the analysis to correctly represent potential infinity values in the computed ranges.
In Details
In the range-op-float pass, the operator_cast::fold_range function was modified to call frange_drop_infs after handling integer-to-floating-point conversions. This was based on an incorrect assumption that integers converted to floats would never yield infinity. However, due to the limited range of _Float16 or large _BitInt types, infinity can indeed be a result. This commit corrects the misstep by removing the frange_drop_infs call, ensuring that potential infinity values are not prematurely discarded during range analysis.
- range-op-float
- A GCC optimization pass that analyzes and manipulates ranges of floating-point values to enable further optimizations.
- frange_drop_infs
- A function within GCC's range analysis framework that removes positive or negative infinity from a floating-point range.
- operator_cast::fold_range
- A method within the GCC compiler that optimizes range-based calculations involving type casts, particularly for floating-point numbers.
- _Float16
- A half-precision floating-point data type, defined by the IEEE 754 standard, with a smaller range and precision than single-precision floats.
- _BitInt
- A GCC extension for arbitrary-precision integers, allowing integers of specified bit lengths beyond standard types like int or long.