summaryrefslogtreecommitdiff
path: root/gcc/cgraphbuild.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2008-12-06 08:34:20 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2008-12-06 08:34:20 +0000
commit9f694a827ab82aa4256f0bb5c870eda8f69ec26a (patch)
tree1c3592ee7c56ccfdd8c2ce7168b872880b33ba1d /gcc/cgraphbuild.c
parente57e60cb26ce39d3c4707869a6375ba2e00e2ebc (diff)
downloadgcc-9f694a827ab82aa4256f0bb5c870eda8f69ec26a.tar.gz
PR tree-optimization/38074
* cgraphbuild.c (compute_call_stmt_bb_frequency): Fix handling of 0 entry frequency. * predict.c (combine_predictions_for_bb): Ignore predictor predicting in both dirrection for first match heuristics. (tree_bb_level_predictions): Disable noreturn heuristic when there is no returning path. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142517 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphbuild.c')
-rw-r--r--gcc/cgraphbuild.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index 958fed7b0cc..75db87544ce 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -109,13 +109,12 @@ int
compute_call_stmt_bb_frequency (basic_block bb)
{
int entry_freq = ENTRY_BLOCK_PTR->frequency;
- int freq;
+ int freq = bb->frequency;
if (!entry_freq)
- entry_freq = 1;
+ entry_freq = 1, freq++;
- freq = (!bb->frequency && !entry_freq ? CGRAPH_FREQ_BASE
- : bb->frequency * CGRAPH_FREQ_BASE / entry_freq);
+ freq = freq * CGRAPH_FREQ_BASE / entry_freq;
if (freq > CGRAPH_FREQ_MAX)
freq = CGRAPH_FREQ_MAX;