summaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index 776ea7e9a79..78f15e388e3 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -150,6 +150,8 @@ maybe_hot_count_p (gcov_type count)
bool
maybe_hot_bb_p (const_basic_block bb)
{
+ /* Make sure CFUN exists, for dump_bb_info. */
+ gcc_assert (cfun);
if (profile_status == PROFILE_READ)
return maybe_hot_count_p (bb->count);
return maybe_hot_frequency_p (bb->frequency);
@@ -201,6 +203,8 @@ maybe_hot_edge_p (edge e)
bool
probably_never_executed_bb_p (const_basic_block bb)
{
+ /* Make sure CFUN exists, for dump_bb_info. */
+ gcc_assert (cfun);
if (profile_info && flag_branch_probabilities)
return ((bb->count + profile_info->runs / 2) / profile_info->runs) == 0;
if ((!profile_info || !flag_branch_probabilities)