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

Constify and abstract pt_solution API

GCC abstracts the `pt_solution` API for SSA names, enforcing const access and preparing for data structure consolidation.

This commit abstracts the pt_solution API for SSA names in GCC, ensuring that the pt_solution field is only accessed via a const pointer. Access is now managed through dedicated functions like ssa_name_pt_solution() and set_ssa_name_pt_solution(). This change removes references to the ptr_info_def structure, facilitating its eventual removal and making pt_solution a direct member of prange_storage.

In Details

This patch refactors the API for accessing and modifying pt_solution within GCC's SSA analysis. It introduces ssa_name_pt_solution() to acquire a const pointer to the pt_solution and set_ssa_name_pt_solution() for modification. This abstraction is a crucial step in removing the ptr_info_def structure, as it decouples clients from its internal layout and prepares pt_solution to be a direct member of prange_storage. The DR_PTR_INFO structure and duplicate_ssa_name_ptr_info function are adjusted accordingly.

For Context
SSA
Static Single Assignment. An intermediate representation in compilers where every variable is assigned a value exactly once.
pt_solution
Points-to solution. In alias analysis, this represents the set of memory locations that a pointer might possibly point to.
prange_storage
A data structure within GCC used to store range information for values, particularly relevant in pointer analysis and optimization passes.
const pointer
A pointer that is guaranteed not to modify the data it points to.
Filed Under: gccssaalias-analysisrefactor