GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
tree-optimization

Path ranger in tree-optimization disallowed from current_range_query.

Path ranger in GCC's tree-optimization is prevented from using current_range_query to avoid incorrect range calculations.

A generic mechanism to set the current range query has been introduced, and the path ranger is now disallowed from using it. This prevents the path ranger from providing incorrect ranges for requests not dominated by the path it is analyzing, fixing a bug in range analysis.

In Details

The path_ranger pass, used in GIMPLE optimization, can now provide incorrect range information if it relies on current_range_query established by other passes. This commit introduces set_range_query as the canonical way to manage the active range_query and modifies path_ranger to not use it, ensuring its analyses are self-contained and correct, especially in the context of Value Range Propagation (VRP).

For Context
GIMPLE
GCC's internal representation (IR) used for optimization passes. It's a three-address code-like form.
path ranger
A component within GCC's tree-optimization framework that analyzes ranges along execution paths.
current_range_query
A mechanism within GCC's value analysis framework that provides the current range information for a variable.
Value Range Propagation (VRP)
An optimization pass in GCC that determines the possible range of values for variables.
Filed Under: optimizationtree-optimizationbugfix