When a callback-carrying edge is redirected to __builtin_unreachable,
the associated callbacks will never get called, so the corresponding
callback edges must be deleted, as they no longer reflect the reality.
The line in analyze_function_body is an obvious typo I discovered during
debugging, so I decided to bundle it in.
gcc/ChangeLog:
* ipa-fnsummary.cc (redirect_to_unreachable): Purge callback
edges when redirecting the carrying edge.
(analyze_function_body): Fix typo.
Signed-off-by: Josef Melcr <jmelcr02@gmail.com>
es->call_stmt_time = 0;
if (callee)
callee->remove_symbol_and_inline_clones ();
+ if (e->has_callback)
+ e->purge_callback_edges ();
return e;
}
for (cbe = edge->first_callback_edge (); cbe;
cbe = cbe->next_callback_edge ())
{
- ipa_call_summary *es2 = ipa_call_summaries->get (cbe);
- es2 = ipa_call_summaries->get_create (cbe);
+ ipa_call_summary *es2 = ipa_call_summaries->get_create (cbe);
ipa_call_summaries->duplicate (edge, cbe, es, es2);
/* Unlike speculative edges, callback edges have no real
size or time; the call doesn't exist. Reflect that in