GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
ipa

IPA adds missing call to duplication hooks.

Fixes an ICE in ipa-sra by adding missing duplication hook calls in cgraph_edge::make_callback.

This commit fixes an internal compiler error (ICE) in the ipa-sra pass by adding a missing call to duplication hooks within cgraph_edge::make_callback. The absence of this call prevented necessary summaries from being copied for newly added callback edges, leading to segfaults. The change also refactors initialization logic for summaries of callback edges to improve consistency.

In Details

An ICE in ipa-sra triggered by PR125121, occurring when -fno-ipa-cp is used, is resolved by adding a call to edge duplication hooks in cgraph_edge::make_callback. This ensures that summaries required by ipa-sra are correctly duplicated for dynamic edges introduced by cgraph_edge::make_callback. Initialization logic for callback edge summaries in ipa-prop.cc is also slightly adjusted for consistency.

For Context
IPA
Interprocedural Analysis, a set of compiler optimization techniques that analyze code across function boundaries.
ipa-sra
Interprocedural Scalar Replacement of Aggregates, an optimization pass that replaces aggregate structures passed between functions with scalar variables where possible.
hooks
Callback functions or points in the compiler's execution where custom logic can be inserted or executed.
cgraph_edge
Represents an edge in the call graph of a program, connecting a caller function to a callee function.
-fno-ipa-cp
A compiler flag that disables Interprocedural Constant Propagation, an optimization that propagates constants across function calls.
Filed Under: ipaoptimizationbugfixICE