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

forwprop: Avoid folding CONSTRUCTOR into abnormal PHI vectors [PR128013]

forwprop now avoids folding vector constructors into abnormal PHI vectors to prevent SSA out-of-bounds errors.

The simplify_vector_constructor pass in forwprop has been updated to prevent folding CONSTRUCTOR expressions into abnormal PHI nodes. This optimization previously extended the live ranges of vectors, causing conflicts with SSA form when the vector was an SSA name in an abnormal PHI and redefined before the constructor. The change ensures correct SSA form and avoids out-of-SSA errors.

In Details

The forwprop pass's simplify_vector_constructor function was replacing a CONSTRUCTOR of BIT_FIELD_REFs with a permutation or the vector itself, extending live ranges. This interfered with SSA form when the involved vector was an SSA name in an abnormal PHI and subsequently redefined. This commit modifies simplify_vector_constructor to avoid such folding, aligning with gimple_simplify's behavior and the fix for PR125502, thus preserving SSA invariants.

For Context
forwprop
Forward Propagation, a compiler optimization pass that moves computations forward in the program flow.
CONSTRUCTOR
An intermediate representation construct used to initialize aggregate data types like structures or vectors.
PHI node
A special node in SSA (Static Single Assignment) form that represents the merging of values from different control flow paths.
abnormal PHI
A PHI node that does not satisfy certain structural properties, potentially complicating SSA-based optimizations.
SSA form
Static Single Assignment form, an intermediate representation where every variable is assigned exactly once.
BIT_FIELD_REF
An intermediate representation for accessing a bit field within a larger data unit.
live ranges
The scope within a program where a variable holds a value that might be used later.
Filed Under: optimizationssaforwprop