GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc

set_pt_unknown may revert to VARYING

Fixes value-range analysis to correctly set VR_VARYING when needed.

This commit corrects the behavior of prange::set_pt_unknown in GCC’s value-range analysis. When called on a range that has points-to information and is otherwise varying, the function now correctly sets the range’s kind back to VR_VARYING, ensuring accurate data flow analysis.

In Details

In gcc/value-range.h, the prange::set_pt_unknown function previously did not correctly reset the range kind to VR_VARYING when the input range had points-to information and was otherwise varying. This change ensures that such cases properly transition to a VR_VARYING state, maintaining the integrity of points-to analysis.

For Context
value-range analysis
A compiler optimization technique that determines the possible range of values a variable or expression can take during program execution.
points-to information
Information about which memory locations a pointer might refer to during program execution, crucial for alias analysis.
VR_VARYING
A state in GCC's value-range analysis indicating that the range of possible values is not constant and can vary.
Filed Under: optimizationvalue-range analysis