]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/ipa-comdats.c
2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
[thirdparty/gcc.git] / gcc / ipa-comdats.c
index 4fa3e1464280cb76634a9201ea9a2f00379a6c3a..69cc3f3b907f1e51e8a1272480042fb0c06aa912 100644 (file)
@@ -1,5 +1,5 @@
 /* Localize comdats.
-   Copyright (C) 2014-2017 Free Software Foundation, Inc.
+   Copyright (C) 2014-2019 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -82,7 +82,7 @@ propagate_comdat_group (struct symtab_node *symbol,
          continue;
        }
 
-      /* One COMDAT group can not hold both variables and functions at
+      /* One COMDAT group cannot hold both variables and functions at
         a same time.  For now we just go to BOTTOM, in future we may
         invent special comdat groups for this case.  */
 
@@ -127,7 +127,7 @@ propagate_comdat_group (struct symtab_node *symbol,
 
        if (cgraph_node * cn = dyn_cast <cgraph_node *> (symbol2))
          {
-           /* Thunks can not call across section boundary.  */
+           /* Thunks cannot call across section boundary.  */
            if (cn->thunk.thunk_p)
              newgroup = propagate_comdat_group (symbol2, newgroup, map);
            /* If we see inline clone, its comdat group actually
@@ -211,8 +211,11 @@ set_comdat_group (symtab_node *symbol,
   symtab_node *head = (symtab_node *)head_p;
 
   gcc_assert (!symbol->get_comdat_group ());
-  symbol->set_comdat_group (head->get_comdat_group ());
-  symbol->add_to_same_comdat_group (head);
+  if (symbol->real_symbol_p ())
+    {
+      symbol->set_comdat_group (head->get_comdat_group ());
+      symbol->add_to_same_comdat_group (head);
+    }
   return false;
 }
 
@@ -254,7 +257,7 @@ ipa_comdats (void)
        /* Mark the symbol so we won't waste time visiting it for dataflow.  */
        symbol->aux = (symtab_node *) (void *) 1;
       }
-    /* See symbols that can not be privatized to comdats; that is externally
+    /* See symbols that cannot be privatized to comdats; that is externally
        visible symbols or otherwise used ones.  We also do not want to mangle
        user section names.  */
     else if (symbol->externally_visible