]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* function.c (dup_block_and_redirect): Update profile.
authorJan Hubicka <jh@suse.cz>
Sat, 29 Sep 2012 12:31:49 +0000 (14:31 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 29 Sep 2012 12:31:49 +0000 (12:31 +0000)
From-SVN: r191851

gcc/ChangeLog
gcc/function.c

index 068a264c90551c5236ea02de865213c5313d1939..1845cfc21b1ca3f84e8839601081acb05e427018 100644 (file)
@@ -1,3 +1,7 @@
+2012-09-28  Jan Hubicka  <jh@suse.cz>
+
+       * function.c (dup_block_and_redirect): Update profile.
+
 2012-09-29  Andreas Tobler  <andreast@fgznet.ch>
 
        * config.gcc: Replace 'host' with 'target' when configuring for
index d6e19543753c510bfb57640ce6a97ef9dd72835b..9efbc3ad27061ce3555440276f089bec56ada909 100644 (file)
@@ -5668,6 +5668,15 @@ dup_block_and_redirect (basic_block bb, basic_block copy_bb, rtx before,
   for (ei = ei_start (bb->preds); (e = ei_safe_edge (ei)); )
     if (!bitmap_bit_p (need_prologue, e->src->index))
       {
+       int freq = EDGE_FREQUENCY (e);
+       copy_bb->count += e->count;
+       copy_bb->frequency += EDGE_FREQUENCY (e);
+       e->dest->count -= e->count;
+       if (e->dest->count < 0)
+         e->dest->count = 0;
+       e->dest->frequency -= freq;
+       if (e->dest->frequency < 0)
+         e->dest->frequency = 0;
        redirect_edge_and_branch_force (e, copy_bb);
        continue;
       }