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

Correct ranger transitive table for equality relations

Fixes an error in the value relation transitive table, ensuring correct propagation of equality and inequality.

The transitive relation table in value-relation.cc has been corrected to accurately reflect the transitive properties of equality and inequality. Previously, it failed to deduce x != z from x == y and y != z, or from x != y and y == z. This update ensures proper propagation of these relations.

In Details

The rr_transitive_table in value-relation.cc is updated to fix incorrect entries for equality (=) and inequality (!=). Specifically, it now correctly computes the transitive closure for cases like x = y, y != z => x != z and x != y, y = z => x != z, which are crucial for accurate value range propagation in the SSA (Static Single Assignment) form.

For Context
transitive relation
A relation where if 'a' is related to 'b' and 'b' is related to 'c', then 'a' is related to 'c'. Examples include equality and less-than-or-equal-to.
value relation
In compilers, this refers to the relationships between different values or expressions within the code, used for optimization and analysis. The value-relation.cc file likely manages these relationships.
SSA
Static Single Assignment form. An intermediate representation in compilers where every variable is assigned a value exactly once, simplifying many optimizations.
tree-ssa
Refers to the compiler's internal representation and optimization passes that operate on the SSA form, often built upon an Abstract Syntax Tree (AST) or similar tree structure.
Filed Under: optimizationcompiler-bug