]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cgraph.c
re PR c++/41090 (Using static label reference in c++ class constructor produces wrong...
[thirdparty/gcc.git] / gcc / cgraph.c
index 9501afa0c668c051ca4dbfc77b5faf33fb922ff8..ccd150c81450fba860e565f58aab38fa9b168607 100644 (file)
@@ -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