re PR lto/78407 (LTO breaks separate overriding of symbol aliases)
authorJan Hubicka <hubicka@ucw.cz>
Sat, 21 Jan 2017 19:36:01 +0000 (20:36 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 21 Jan 2017 19:36:01 +0000 (19:36 +0000)
PR lto/78407
* cfg.c (update_bb_profile_for_threading): Fix updating of probablity.

From-SVN: r244749

gcc/ChangeLog
gcc/cfg.c

index 95c54e5b82ea1cee222f96958215e06ebed8d8f2..2980e46f4b8df23ddcb49b92903b90e2021e1370 100644 (file)
@@ -1,3 +1,8 @@
+2017-01-21  Jan Hubicka  <hubicka@ucw.cz>
+
+       PR lto/78407
+       * cfg.c (update_bb_profile_for_threading): Fix updating of probablity.
+
 2017-01-21  Bernd Schmidt  <bschmidt@redhat.com>
 
        rtl-optimization/79125
index 97cc755cccd378a520e1abf4902bbfbeb0fbf2cd..1bcf9b8227f8fa28f6886fe9d93e1e01a7ecac4e 100644 (file)
--- 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)