re PR bootstrap/80978 (LTO/PGO bootstrap broken by r248863)
authorJan Hubicka <hubicka@ucw.cz>
Tue, 6 Jun 2017 11:30:54 +0000 (13:30 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 6 Jun 2017 11:30:54 +0000 (11:30 +0000)
PR bootstrap/80978
* tree-cfg.c (execute_fixup_cfg): Fix condition on when to rescale
profile.

From-SVN: r248915

gcc/ChangeLog
gcc/tree-cfg.c

index baee1e6..1e0542e 100644 (file)
@@ -1,5 +1,11 @@
 2017-06-06  Jan Hubicka  <hubicka@ucw.cz>
 
+       PR bootstrap/80978
+       * tree-cfg.c (execute_fixup_cfg): Fix condition on when to rescale
+       profile.
+
+2017-06-06  Jan Hubicka  <hubicka@ucw.cz>
+
        * shrink-wrap.c (handle_simple_exit): Update profile.
        (try_shrink_wrapping): Upate profile.
 
index 1d5271a..c84e99d 100644 (file)
@@ -9077,7 +9077,9 @@ execute_fixup_cfg (void)
   cgraph_node *node = cgraph_node::get (current_function_decl);
   profile_count num = node->count;
   profile_count den = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
-  bool scale = num.initialized_p () && den.initialized_p () && !(num == den);
+  bool scale = num.initialized_p ()
+              && (den > 0 || num == profile_count::zero ())
+              && !(num == den);
 
   if (scale)
     {