aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2017-06-05 19:41:32 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2017-06-05 17:41:32 +0000
commitaea5e79a63f965a9ed5fd2ef1943e3865495e987 (patch)
tree52c60043f6ed486d65cb1a8a38cb71979166465c /gcc/ipa-inline.c
parent2f20e7db2caea4909ddff539b2419c9f34c907c4 (diff)
downloadgcc-aea5e79a63f965a9ed5fd2ef1943e3865495e987.zip
gcc-aea5e79a63f965a9ed5fd2ef1943e3865495e987.tar.gz
gcc-aea5e79a63f965a9ed5fd2ef1943e3865495e987.tar.bz2
cfgexpand.c (expand_gimple_tailcall): Initialize profile of new edge.
* cfgexpand.c (expand_gimple_tailcall): Initialize profile of new edge. * ipa-inline.c (want_inline_self_recursive_call_p): Watch for missing profile in callgraph edge. * profile-count.h (apply_probability): If THIS is 0, then result is 0 (apply_scale): Likewise. * tree-inline.c (copy_bb, copy_edges_for_bb, copy_cfg_body): Also scale profile when inlining function with zero profile. (initialize_cfun): Update exit block profile even when it is zero. * tree-ssa-threadupdate.c (clear_counts_path): Handle correctly case when profile is read. From-SVN: r248885
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 8900556..64c9ebd 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -912,7 +912,7 @@ want_inline_self_recursive_call_p (struct cgraph_edge *edge,
methods. */
else
{
- if (max_count > profile_count::zero ()
+ if (max_count > profile_count::zero () && edge->count.initialized_p ()
&& (edge->count.to_gcov_type () * 100
/ outer_node->count.to_gcov_type ()
<= PARAM_VALUE (PARAM_MIN_INLINE_RECURSIVE_PROBABILITY)))
@@ -920,7 +920,8 @@ want_inline_self_recursive_call_p (struct cgraph_edge *edge,
reason = "profile of recursive call is too small";
want_inline = false;
}
- else if (max_count == profile_count::zero ()
+ else if ((max_count == profile_count::zero ()
+ || !edge->count.initialized_p ())
&& (edge->frequency * 100 / caller_freq
<= PARAM_VALUE (PARAM_MIN_INLINE_RECURSIVE_PROBABILITY)))
{