Hi 

> On 7 Jan 2026, at 3:04 am, Dhruv Chawla <[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.
> ---
> 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
> 

I also ran into this issue and the change makes sense to me for what it is 
worth.

Thanks,
Kugan

Reply via email to