diff options
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 9501afa..ccd150c 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -2666,10 +2666,18 @@ verify_cgraph_node (struct cgraph_node *node) error_found = true; } } + bool check_comdat = symtab_comdat_local_p (node); for (e = node->callers; e; e = e->next_caller) { if (verify_edge_count_and_frequency (e)) error_found = true; + if (check_comdat + && !symtab_in_same_comdat_p (e->caller, node)) + { + error ("comdat-local function called by %s outside its comdat", + identifier_to_locale (e->caller->name ())); + error_found = true; + } if (!e->inline_failed) { if (node->global.inlined_to |