OSDN Git Service

Fix a bug in cfg fixup
authordavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Aug 2011 06:22:15 +0000 (06:22 +0000)
committerdavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Aug 2011 06:22:15 +0000 (06:22 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177313 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-optimize.c

index 1f84610..58daaa3 100644 (file)
@@ -1,5 +1,10 @@
 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
        function frequency after profile annotation.
 
index 411886c..5479d90 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