Update max_bb_count in execute_fixup_cfg
authorJan Hubicka <hubicka@ucw.cz>
Sat, 30 Nov 2019 21:25:24 +0000 (22:25 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 30 Nov 2019 21:25:24 +0000 (21:25 +0000)
* tree-cfg.c (execute_fixup_cfg): Update also max_bb_count when
scaling happen.

From-SVN: r278879

gcc/ChangeLog
gcc/tree-cfg.c

index c03556b8d3b768f2405a204f37060ab9912f8647..e173bad5c4423384db855a5997ddb03ad5b58376 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-30  Jan Hubicka  <hubicka@ucw.cz>
+
+       * tree-cfg.c (execute_fixup_cfg): Update also max_bb_count when
+       scaling happen.
+
 2019-11-30  Jan Hubicka  <hubicka@ucw.cz>
 
        * cgraph.h (symtab_node): Add symver flag.
index eb268e32b2ddb605d1aa24f827db601758374429..8e5179e6291aa2045acb015190d0bd277c96f2c0 100644 (file)
@@ -9551,6 +9551,7 @@ execute_fixup_cfg (void)
   gimple_stmt_iterator gsi;
   int todo = 0;
   cgraph_node *node = cgraph_node::get (current_function_decl);
+  /* Same scaling is also done by ipa_merge_profiles.  */
   profile_count num = node->count;
   profile_count den = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
   bool scale = num.initialized_p () && !(num == den);
@@ -9664,7 +9665,10 @@ execute_fixup_cfg (void)
        }
     }
   if (scale)
-    compute_function_frequency ();
+    {
+      update_max_bb_count ();
+      compute_function_frequency ();
+    }
 
   if (current_loops
       && (todo & TODO_cleanup_cfg))