diff options
Diffstat (limited to 'gcc/cgraphclones.c')
-rw-r--r-- | gcc/cgraphclones.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index ef39d85..0e7e35b 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -428,7 +428,10 @@ cgraph_node::create_clone (tree new_decl, profile_count prof_count, if (new_inlined_to) dump_callgraph_transformation (this, new_inlined_to, "inlining to"); - prof_count = count.combine_with_ipa_count (prof_count); + /* When inlining we scale precisely to prof_count, when cloning we can + preserve local profile. */ + if (!new_inlined_to) + prof_count = count.combine_with_ipa_count (prof_count); new_node->count = prof_count; /* Update IPA profile. Local profiles need no updating in original. */ |