aboutsummaryrefslogtreecommitdiff
path: root/gcc/profile.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2008-09-01 18:28:06 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2008-09-01 16:28:06 +0000
commitba623cedf4b07b3a2c2f3e638fa379bcde55c42e (patch)
treeacd38c7a826f584bcddf0792b749cd9537cd440f /gcc/profile.c
parent6a3799eb0065d62b04315aa2a9808bce71dab54b (diff)
downloadgcc-ba623cedf4b07b3a2c2f3e638fa379bcde55c42e.zip
gcc-ba623cedf4b07b3a2c2f3e638fa379bcde55c42e.tar.gz
gcc-ba623cedf4b07b3a2c2f3e638fa379bcde55c42e.tar.bz2
predict.c (maybe_hot_count_p, [...]): When profile is present, use only counts; when guessed use only frequencies.
* predict.c (maybe_hot_count_p, maybe_hot_edge_p): When profile is present, use only counts; when guessed use only frequencies. (estimate_bb_frequencies): Use function_frequency. * profile.c (compute_branch_probabilities): Exit early when profile reading failed. Set profile_status. (branch_prob): Do not set profile_status. From-SVN: r139868
Diffstat (limited to 'gcc/profile.c')
-rw-r--r--gcc/profile.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/gcc/profile.c b/gcc/profile.c
index 6f89645..883515d 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -402,19 +402,18 @@ compute_branch_probabilities (void)
int inconsistent = 0;
/* Very simple sanity checks so we catch bugs in our profiling code. */
- if (profile_info)
+ if (!profile_info)
+ return;
+ if (profile_info->run_max * profile_info->runs < profile_info->sum_max)
{
- if (profile_info->run_max * profile_info->runs < profile_info->sum_max)
- {
- error ("corrupted profile info: run_max * runs < sum_max");
- exec_counts = NULL;
- }
+ error ("corrupted profile info: run_max * runs < sum_max");
+ exec_counts = NULL;
+ }
- if (profile_info->sum_all < profile_info->sum_max)
- {
- error ("corrupted profile info: sum_all is smaller than sum_max");
- exec_counts = NULL;
- }
+ if (profile_info->sum_all < profile_info->sum_max)
+ {
+ error ("corrupted profile info: sum_all is smaller than sum_max");
+ exec_counts = NULL;
}
/* Attach extra info block to each bb. */
@@ -695,6 +694,7 @@ compute_branch_probabilities (void)
}
}
counts_to_freqs ();
+ profile_status = PROFILE_READ;
if (dump_file)
{
@@ -1154,8 +1154,6 @@ branch_prob (void)
VEC_free (histogram_value, heap, values);
free_edge_list (el);
- if (flag_branch_probabilities && profile_info)
- profile_status = PROFILE_READ;
coverage_end_function ();
}