On 11/01/26 13:58, Andrew Pinski wrote:
External email: Use caution opening links or attachments


On Tue, Jan 6, 2026 at 8:05 AM <[email protected]> wrote:

From: Dhruv Chawla <[email protected]>

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.

This is ok. Just for others wondering, in_map is just `index_inst !=
nullptr` which makes sense as the check here.

Thanks, committed as r16-6701-gcbb7ec9e066af7.

--
Regards,
Dhruv


Thanks,
Andrew

---
  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 06ea4015251..7fa9966c319 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;
         }
--
2.44.0

Reply via email to