summaryrefslogtreecommitdiff
path: root/gcc/cfg.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2017-01-21 20:36:01 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2017-01-21 19:36:01 +0000
commita6a70dcad2d9f329fffb4d5eb39b02699df2e7ed (patch)
tree620053cdd7b36b632d57e5685e05c239c76cf8ec /gcc/cfg.c
parent509912a611f9e86883cd1f3c1751e4a1b3cb7abf (diff)
downloadgcc-a6a70dcad2d9f329fffb4d5eb39b02699df2e7ed.tar.gz
re PR lto/78407 (LTO breaks separate overriding of symbol aliases)
PR lto/78407 * cfg.c (update_bb_profile_for_threading): Fix updating of probablity. From-SVN: r244749
Diffstat (limited to 'gcc/cfg.c')
-rw-r--r--gcc/cfg.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 97cc755cccd..1bcf9b8227f 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -869,6 +869,10 @@ update_bb_profile_for_threading (basic_block bb, int edge_frequency,
bb->count = 0;
}
+ bb->frequency -= edge_frequency;
+ if (bb->frequency < 0)
+ bb->frequency = 0;
+
/* Compute the probability of TAKEN_EDGE being reached via threaded edge.
Watch for overflows. */
if (bb->frequency)
@@ -882,15 +886,12 @@ update_bb_profile_for_threading (basic_block bb, int edge_frequency,
"%i->%i too small (it is %i, should be %i).\n",
taken_edge->src->index, taken_edge->dest->index,
taken_edge->probability, prob);
- prob = taken_edge->probability;
+ prob = taken_edge->probability * 6 / 8;
}
/* Now rescale the probabilities. */
taken_edge->probability -= prob;
prob = REG_BR_PROB_BASE - prob;
- bb->frequency -= edge_frequency;
- if (bb->frequency < 0)
- bb->frequency = 0;
if (prob <= 0)
{
if (dump_file)