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 baee1e65eb47220992967b42f16fb7dbcfdbb114..1e0542e82231a65f59ac6ebe1f4db8688e03d897 100644 (file)
@@ -1,3 +1,9 @@
+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.
index 1d5271a085c688de173794123121b78cadb2085a..c84e99d09454a9a068e8ad40e14c684fe13f733e 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)
     {