https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101625
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
So it's IPA ICF that creates the summary via ipa_icf::sem_function::merge
which does
1309 symtab->call_cgraph_insertion_hooks (alias);
and that lazily creates a summary node but does not initialize it in a
meaningful way:
(gdb) p *$15
$17 = {loads = 0x0, stores = 0x0,
kills = {<vec<modref_access_node, va_heap, vl_ptr>> = {
m_vec = 0x0}, <No data fields>},
arg_flags = {<vec<unsigned short, va_heap, vl_ptr>> = {
m_vec = 0x0}, <No data fields>}, retslot_flags = 0,
static_chain_flags = 0, writes_errno = 0, side_effects = 0,
nondeterministic = 0, calls_interposable = 0, load_accesses = 2947526575,
global_memory_read = 0, global_memory_written = 0, try_dse = 0}
not sure why it should do that? Backtrace for the summary creation:
#2 0x0000000001513480 in function_summary_base<modref_summary>::allocate_new (
this=0x7ffff7fb84e0)
at /space/rguenther/src/gcc-clean/gcc/symbol-summary.h:108
#3 0x000000000150fbb5 in fast_function_summary<modref_summary*,
va_gc>::get_create (this=0x7ffff7fb84e0,
node=<cgraph_node * 0x7ffff669e110 "XXH64_freeState"/1>)
at /space/rguenther/src/gcc-clean/gcc/symbol-summary.h:400
#4 0x0000000001511538 in fast_function_summary<modref_summary*,
va_gc>::symtab_insertion (node=<cgraph_node * 0x7ffff669e110
"XXH64_freeState"/1>,
data=0x7ffff7fb84e0)
at /space/rguenther/src/gcc-clean/gcc/symbol-summary.h:483
#5 0x0000000001105add in symbol_table::call_cgraph_insertion_hooks (
this=0x7ffff6806000,
node=<cgraph_node * 0x7ffff669e110 "XXH64_freeState"/1>)
at /space/rguenther/src/gcc-clean/gcc/cgraph.cc:537
#6 0x000000000337be53 in ipa_icf::sem_function::merge (this=0x4c7f830,
alias_item=0x4d19c60) at /space/rguenther/src/gcc-clean/gcc/ipa-icf.cc:1309
it's not clear to me what exactly a NULL loads/stores means semantically,
but it seems useful_p would be false, meaning we'd usually drop it again.
There doesn't seem to be an API to kill the created modref summary immediately.
Honza?