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

Add support for unknown offset accesses in ipa-predicates

GCC's IPA can now analyze conditions involving aggregate parameters with unknown memory offsets.

This patch introduces support in GCC’s interprocedural analysis (IPA) predicates for handling situations where a conditional expression involves an aggregate parameter with an unknown memory offset. When the parameter points to a string constant, the analysis can now inspect the string to infer information, similar to how it handles specific characters. This is a foundational step towards better analysis of such cases, with further work on PHI nodes and jump functions planned.

In Details

Commit 7ce404d9c953b0a1b51e1501ca7332b037170481 adds foundational support for unknown_offset accesses within ipa-predicates in gcc/ipa-fnsummary.cc and gcc/ipa-predicate.cc. This allows the analysis to inspect string literals pointed to by such accesses, enabling more precise condition evaluation for functions like cppcheck. It introduces new functions for string character analysis and updates data structures to track the unknown_offset state. This work, related to PR ipa/127171, is a prerequisite for later commits that add PHI walking and improve predicate logic for unknown off…

For Context
Interprocedural Analysis (IPA)
A compile-time analysis that examines relationships and dependencies between different functions within a program, rather than just a single function in isolation. It's used to enable optimizations that require knowledge beyond a single function's scope.
ipa-predicates
A component within GCC's IPA subsystem that represents conditions and properties of function parameters and return values, used to guide optimization decisions.
unknown_offset
A state in GCC's analysis indicating that the precise memory offset being accessed within an aggregate data structure cannot be determined at compile time. This often occurs with pointer arithmetic or indirect accesses.
aggregate
A data structure that groups together multiple values, such as a struct or an array.
STRING_CST
An internal representation in GCC for a string constant.
Filed Under: optimizationIPAanalysis