Hi Honza,
>
> diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc
> index 6aa5166c748..63ca8938146 100644
> --- a/gcc/auto-profile.cc
> +++ b/gcc/auto-profile.cc
> @@ -3326,6 +3333,14 @@ afdo_indirect_call (gcall *stmt, const
> icall_target_map &map,
> afdo_string_table->get_symbol_name (max_iter->first));
> return false;
> }
> + if (direct_call->local)
> + {
> + if (dump_file)
> + fprintf (dump_file, "AFDO Indirect call target %s "
> + "is local and thus can not be called indirectly\n",
> + afdo_string_table->get_symbol_name (max_iter->first));
> + return false;
> + }
>
> callee = gimple_call_fn (stmt);
>
Yes, this works for me and looks correct to me. Do you plan to commit this?
Thanks
Kugan