summaryrefslogtreecommitdiff
path: root/gcc/ipa-profile.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2018-01-24 17:18:18 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2018-01-24 16:18:18 +0000
commit35d93d1d8caeddb4d990c8391fff2587bed8a3cd (patch)
tree4c2cdd81abb1e79324639c88fa340e63a6bb1a3c /gcc/ipa-profile.c
parent0976f13bee1b7d472723ce5f37930b54f119feae (diff)
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
Diffstat (limited to 'gcc/ipa-profile.c')
-rw-r--r--gcc/ipa-profile.c8
1 files changed, 3 insertions, 5 deletions
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)
{