From 86fdda05914d35026362dbf8bee8520d7e549525 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 6 Jun 2017 13:30:54 +0200 Subject: [PATCH] re PR bootstrap/80978 (LTO/PGO bootstrap broken by r248863) PR bootstrap/80978 * tree-cfg.c (execute_fixup_cfg): Fix condition on when to rescale profile. From-SVN: r248915 --- gcc/ChangeLog | 6 ++++++ gcc/tree-cfg.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index baee1e65eb4..1e0542e8223 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-06-06 Jan Hubicka + + PR bootstrap/80978 + * tree-cfg.c (execute_fixup_cfg): Fix condition on when to rescale + profile. + 2017-06-06 Jan Hubicka * shrink-wrap.c (handle_simple_exit): Update profile. diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 1d5271a085c..c84e99d0945 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -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) { -- 2.30.2