diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2019-11-29 11:29:44 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2019-11-29 10:29:44 +0000 |
commit | db51f624df2a965f70de70239c35e882b4897582 (patch) | |
tree | 25f8ed56b4c02634f18203902cde0e06f274974e /gcc/cgraph.c | |
parent | 60178a322b4e8d0dc6cf50f57f8fa1fdf624a1f0 (diff) |
profile-count.c (profile_count::to_cgraph_frequency, [...]): Check for compaibility of counts.
* profile-count.c (profile_count::to_cgraph_frequency,
profile_count::to_sreal_scale): Check for compaibility of counts.
* profile-count.h (compatible_p): Make public; add checking for
global0 versus global types.
* cgraph.c (cgraph_node::verify_node): Verify count compatibility.
From-SVN: r278835
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index dd07516b83e..180d21e4796 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -3061,6 +3061,13 @@ cgraph_node::verify_node (void) error ("inline clone in same comdat group list"); error_found = true; } + if (inlined_to && !count.compatible_p (inlined_to->count)) + { + error ("inline clone count is not compatible"); + count.debug (); + inlined_to->count.debug (); + error_found = true; + } if (!definition && !in_other_partition && local) { error ("local symbols must be defined"); @@ -3089,6 +3096,13 @@ cgraph_node::verify_node (void) identifier_to_locale (e->caller->name ())); error_found = true; } + if (!e->count.compatible_p (count)) + { + error ("edge count is not compatible with function count"); + e->count.debug (); + count.debug (); + error_found = true; + } if (!e->indirect_unknown_callee || !e->indirect_info) { @@ -3137,6 +3151,13 @@ cgraph_node::verify_node (void) { if (e->verify_count ()) error_found = true; + if (!e->count.compatible_p (count)) + { + error ("edge count is not compatible with function count"); + e->count.debug (); + count.debug (); + error_found = true; + } if (gimple_has_body_p (e->caller->decl) && !e->caller->inlined_to && !e->speculative |