https://gcc.gnu.org/g:cbb7ec9e066af74183ac7f6d56e35e972ec95278
commit r16-6701-gcbb7ec9e066af74183ac7f6d56e35e972ec95278 Author: Dhruv Chawla <[email protected]> Date: Mon Jan 5 20:44:25 2026 -0800 AutoFDO: Fix missing null-pointer check in offline_unrealized_inlines This was a trivial check that was missing and was causing ICEs due to segmentation faults in some tests. Bootstrapped and regtested on aarch64-linux-gnu. Signed-off-by: Dhruv Chawla <[email protected]> gcc/ChangeLog: * auto-profile.cc (autofdo_source_profile::offline_unrealized_inlines): Add missing check for in_map. Diff: --- gcc/auto-profile.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc index 2434936a0a6c..357b3f46d64c 100644 --- a/gcc/auto-profile.cc +++ b/gcc/auto-profile.cc @@ -2645,7 +2645,8 @@ autofdo_source_profile::offline_unrealized_inlines () if (dump_file) fprintf (dump_file, "Removing optimized out function %s\n", afdo_string_table->get_symbol_name (f->symbol_name ())); - remove_function_instance (index_inst); + if (in_map) + remove_function_instance (index_inst); f->clear_in_worklist (); delete f; }
