PR bootstrap/80978
* tree-cfg.c (execute_fixup_cfg): Fix condition on when to rescale
profile.
From-SVN: r248915
+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.
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)
{