From 35d93d1d8caeddb4d990c8391fff2587bed8a3cd Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 24 Jan 2018 17:18:18 +0100 Subject: [PATCH] ipa-profile.c (ipa_propagate_frequency_1): Fix logic skipping calls with zero counts. * ipa-profile.c (ipa_propagate_frequency_1): Fix logic skipping calls with zero counts. From-SVN: r257020 --- gcc/ChangeLog | 5 +++++ gcc/ipa-profile.c | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5920d361f92..1b64db3eb37 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-01-24 Jan Hubicka + + * ipa-profile.c (ipa_propagate_frequency_1): Fix logic skipping calls + with zero counts. + 2018-01-24 Bill Schmidt * config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv): diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c index 0c972ddb80c..1ab838aca2a 100644 --- a/gcc/ipa-profile.c +++ b/gcc/ipa-profile.c @@ -331,16 +331,14 @@ ipa_propagate_frequency_1 (struct cgraph_node *node, void *data) it is executed by the train run. Transfer the function only if all callers are unlikely executed. */ if (profile_info - && edge->callee->count.initialized_p () - /* Thunks are not profiled. This is more or less implementation - bug. */ - && !d->function_symbol->thunk.thunk_p + && !(edge->callee->count.ipa () == profile_count::zero ()) && (edge->caller->frequency != NODE_FREQUENCY_UNLIKELY_EXECUTED || (edge->caller->global.inlined_to && edge->caller->global.inlined_to->frequency != NODE_FREQUENCY_UNLIKELY_EXECUTED))) d->maybe_unlikely_executed = false; - if (edge->count.initialized_p () && !edge->count.nonzero_p ()) + if (edge->count.ipa ().initialized_p () + && !edge->count.ipa ().nonzero_p ()) continue; switch (edge->caller->frequency) { -- 2.30.2