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

Add ssa_name_range accessors for specialized range types

Introduces shortcut accessors for SSA name range types to simplify code and improve efficiency.

This patch introduces new accessor functions in GCC for specialized SSA name range types, namely ssa_name_irange_info, ssa_name_prange_info, and ssa_name_frange_info. These accessors provide convenient shortcuts for retrieving pointers to specific range storage types. If the range is not of the expected type, the accessors return NULL, preventing potential errors and simplifying the code that utilizes these range informations.

In Details

This commit refactors tree-ssanames.cc and tree-ssanames.h by introducing type-specific accessor functions for SSA_NAME_RANGE_INFO. These new functions (ssa_name_irange_info, ssa_name_prange_info, ssa_name_frange_info) effectively perform a dynamic cast to the desired range type, returning NULL if the type mismatch occurs. This aims to reduce boilerplate in the analysis of SSA names, particularly concerning pointer aliasing and value range information, and replaces a deleted ssa_name_prange_storage struct with these more robust accessors.

For Context
SSA
Static Single Assignment form. A program representation where every variable is assigned exactly once. SSA is an intermediate representation used by compilers to simplify program analysis and optimization.
range information
Data structures within the compiler's intermediate representation that store information about the possible values or ranges of values a variable can take at a particular point in the program. This is crucial for optimizations.
irange_storage
A specific type of storage for representing integer ranges within the compiler's intermediate representation.
prange_storage
A specific type of storage for representing pointer ranges within the compiler's intermediate representation.
frange_storage
A specific type of storage for representing floating-point ranges within the compiler's intermediate representation.
Filed Under: gcccompileroptimizationssa