aboutsummaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2016-06-02 14:51:57 +0200
committerMartin Liska <marxin@gcc.gnu.org>2016-06-02 12:51:57 +0000
commitf3c5ecc2b984e186f043ad03cc7a96a6275f4670 (patch)
treee39cf66c60d50eee2d9159123f798e6d3765277e /gcc/predict.c
parenta91807c5fc51615156e6858ae530247450c8c0b8 (diff)
downloadgcc-f3c5ecc2b984e186f043ad03cc7a96a6275f4670.zip
gcc-f3c5ecc2b984e186f043ad03cc7a96a6275f4670.tar.gz
gcc-f3c5ecc2b984e186f043ad03cc7a96a6275f4670.tar.bz2
Fix first match heuristics
* predict.c (combine_predictions_for_bb): Fix first match in cases where a first predictor contains more than one occurence in list of predictors. Take the best value in such case. * gcc.dg/predict-9.c: New test. From-SVN: r237036
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index e9dda20..429f44e 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -939,7 +939,7 @@ combine_predictions_for_bb (basic_block bb, bool dry_run)
pred2; pred2 = pred2->ep_next)
if (pred2 != pred && pred2->ep_predictor == pred->ep_predictor)
{
- int probability2 = pred->ep_probability;
+ int probability2 = pred2->ep_probability;
if (pred2->ep_edge != first)
probability2 = REG_BR_PROB_BASE - probability2;