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

Create relation immediately in value relation search

Improves value relation analysis by creating relations upfront and then computing ranges.

This change modifies the value relation search to create a new relation immediately, rather than deferring it. After creation, any known range is calculated and intersected with the result. This adjustment aims to improve the efficiency and correctness of the value relation analysis by establishing the relation’s context earlier in the process.

In Details

In dom_oracle::search_and_merge_relation in value-relation.cc, the relation object is now created unconditionally at the start of the function. Previously, it was created conditionally. This change ensures that a relation object always exists, allowing for immediate range calculation and intersection, which may simplify the logic and potentially improve performance or correctness for certain relation merging scenarios.

For Context
value relation
A compiler analysis that tracks relationships between values of variables. It's used to determine properties like whether one value is always greater than, equal to, or within a certain range of another.
relation
In the context of value relation analysis, a data structure representing a specific relationship (e.g., inequality, range) between program variables or expressions.
range
A set of possible values that a variable or expression can take. In compiler analysis, ranges are often used to infer properties about program execution.
tree-optimization
A phase in the GCC compiler that operates on an intermediate representation (IR) called GENERIC/GIMPLE trees. It performs various optimizations by analyzing and transforming these tree structures.
Filed Under: optimizationanalysis