Fix a bug in cfg fixup
authorDavid Li <davidxl@google.com>
Thu, 4 Aug 2011 06:22:15 +0000 (06:22 +0000)
committerXinliang David Li <davidxl@gcc.gnu.org>
Thu, 4 Aug 2011 06:22:15 +0000 (06:22 +0000)
From-SVN: r177313

gcc/ChangeLog
gcc/tree-optimize.c

index 1f846100b8e3dceca9a4a3b025699f6ec97e9100..58daaa31c45ef435da295752f7306c4e7a50bf6c 100644 (file)
@@ -1,3 +1,8 @@
+2011-08-03   David Li  <davidxl@google.com>
+
+       * tree-optimize.c (execute_fixup_cfg): Fix up entry
+       outgoing edge counts after inlining.
+
 2011-08-03   David Li  <davidxl@google.com>
 
        * profile.c (compute_branch_probabilities): Compute
index 411886cacb654e6eb160b7a842ed82d873603b9b..5479d9026a6eac69032e41c158493173e3394a83 100644 (file)
@@ -256,6 +256,10 @@ execute_fixup_cfg (void)
   EXIT_BLOCK_PTR->count = (EXIT_BLOCK_PTR->count * count_scale
                           + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
 
+  FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs)
+    e->count = (e->count * count_scale
+       + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
+
   FOR_EACH_BB (bb)
     {
       bb->count = (bb->count * count_scale