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

Check free list before using a relation.

Fixes a bug where released SSA names could be incorrectly reused in value relations.

This commit prevents a bug where a relation might incorrectly reuse an SSA name that has already been released. Instead of immediately releasing information about a relation, the compiler now lazily checks a free list when registering nearest relations. This ensures that only valid, unreleased SSA names are used, fixing a potential issue in value relation tracking.

In Details

In value-relation.cc, dom_oracle::nearest_relations previously called reset_range_Info in release_ssa_name_fn. This could lead to returning a relation with a released SSA name. The change modifies release_ssa_name_fn to *not* call reset_range_info, and instead, dom_oracle::nearest_relations now lazily checks the free list before adding a name to the relation list. This ensures that SSA names are only added to relations if they are still valid and have not been released.

For Context
SSA name
In Static Single Assignment (SSA) form, an SSA name represents a unique version of a variable after a specific assignment. Each SSA name corresponds to a single definition point.
Value relation
A data structure or analysis that tracks how values of different variables or expressions relate to each other within the program. This can be used for optimizations like constant propagation or dead code elimination.
Free list
A data structure used for memory management that keeps track of available (free) memory blocks or objects that can be reused. In this context, it likely manages reusable SSA name information.
Lazy evaluation
A strategy where the evaluation of an expression is delayed until its value is actually needed. This contrasts with eager evaluation, where expressions are evaluated as soon as they are encountered.
Filed Under: tree-optimizationSSAbugfix