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

Use gassign* for existing gassign* values in store merging and reassociation passes.

Refactors several GCC optimization passes to use the more specific gassign* type, improving type safety and code clarity.

This commit refactors the GCC compiler’s internal representation in several optimization passes, including store-merging, reassociation, and sccvn. It replaces uses of the more general gimple* type with the more specific gassign* where appropriate. This change enhances type safety within the compiler’s intermediate representation and improves code readability by more accurately reflecting the nature of the operations being handled.

In Details

This patch updates type usage in several GIMPLE optimization passes. Specifically, in gimple-ssa-store-merging.cc, tree-ssa-reassoc.cc, and tree-ssa-sccvn.cc, it replaces occurrences of gimple* pointers that are known to point to GIMPLE assignments (GIMPLE_ASSIGN) with gassign*. This is a correctness and clarity improvement within the GIMPLE IR manipulation code, ensuring that the compiler's internal types accurately reflect the specific GIMPLE statement kind being operated on.

For Context
gimple*
A pointer to a GIMPLE statement in GCC's intermediate representation. GIMPLE is a three-address code representation used after the initial parsing and high-level optimization stages.
gassign*
A pointer to a GIMPLE assignment statement (GIMPLE_ASSIGN) in GCC's intermediate representation. This is a more specific type than gimple*.
store merging
An optimization pass that combines multiple store operations into fewer, more efficient ones.
reassociation
An optimization pass that rearranges operands in associative operations (like addition or multiplication) to enable other optimizations or improve performance.
sccvn
Strongly Connected Components Value Numbering, a compiler optimization technique.
Filed Under: gccoptimizationrefactor