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

Remove null field from pt_solution, simplifying pointer analysis.

Eliminates the 'null' field in pt_solution, relying on prange for non-nullness tracking.

This commit removes the ‘null’ field from the pt_solution structure, as it is now redundant. Pointer non-nullness is fully tracked by prange, and the explicit ‘null’ bit was a relic from when this information was managed differently. Helper functions are added to prange_storage and ptr_nonnull_p replaces the old query. This change simplifies pointer analysis by consolidating non-nullness tracking within the prange mechanism.

In Details

The pt_solution structure in alias analysis has been simplified by removing its null field. This field previously served to track pointer non-nullness when prange (pointer range) did not comprehensively cover this information. With prange now fully tracking non-nullness, the pt_solution::null bit is obsolete. The commit introduces ptr_nonnull_p as a replacement for !pt.null and adjusts various functions in tree-ssa-alias.cc, tree-ssanames.cc, and value-query.cc to reflect this change. Flow-sensitive information storage related to nullness is also refactored.

For Context
pt_solution
Points-to solution. Represents information about which memory locations a pointer might refer to. Crucial for alias analysis.
prange
Pointer range. Represents the range of possible values or addresses that a pointer can hold. Now also tracks non-nullness.
alias analysis
Compiler analysis that determines whether different memory references (pointers) might refer to the same memory location.
flow-sensitive information
Information about a variable or pointer that depends on the specific execution path taken through the program.
Filed Under: gccalias analysispointer analysisoptimization