From: Dhruv Chawla Date: Tue, 6 Jan 2026 04:44:25 +0000 (-0800) Subject: AutoFDO: Fix missing null-pointer check in offline_unrealized_inlines X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbb7ec9e066af74183ac7f6d56e35e972ec95278;p=thirdparty%2Fgcc.git 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 gcc/ChangeLog: * auto-profile.cc (autofdo_source_profile::offline_unrealized_inlines): Add missing check for in_map. --- diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc index 2434936a0a6..357b3f46d64 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; }