decl.c (gnat_to_gnu_entity): Minor tweak.
[gcc.git] / gcc / symtab.c
index 38337349d15959dcef18d42a0a739a5005b0980a..156fa3d9f283ea3aeda57494603a278844253809 100644 (file)
@@ -1130,15 +1130,21 @@ symtab_node::verify_symtab_nodes (void)
                                                  &existed);
          if (!existed)
            *entry = node;
-         else
-           for (s = (*entry)->same_comdat_group; s != NULL && s != node; s = s->same_comdat_group)
+         else if (!DECL_EXTERNAL (node->decl))
+           {
+             for (s = (*entry)->same_comdat_group;
+                  s != NULL && s != node && s != *entry;
+                  s = s->same_comdat_group)
+               ;
              if (!s || s == *entry)
                {
-                 error ("Two symbols with same comdat_group are not linked by the same_comdat_group list.");
+                 error ("Two symbols with same comdat_group are not linked by "
+                        "the same_comdat_group list.");
                  (*entry)->debug ();
                  node->debug ();
                  internal_error ("symtab_node::verify failed");
                }
+           }
        }
     }
 }
@@ -1684,6 +1690,8 @@ symtab_node::get_partitioning_class (void)
          objects that can not be duplicated across partitions.  */
       if (DECL_IN_CONSTANT_POOL (decl))
        return SYMBOL_DUPLICATE;
+      if (DECL_HARD_REGISTER (decl))
+       return SYMBOL_DUPLICATE;
       gcc_checking_assert (vnode->definition);
     }
   /* Functions that are cloned may stay in callgraph even if they are unused.
@@ -1924,6 +1932,13 @@ symtab_node::can_increase_alignment_p (void)
   if (TREE_ASM_WRITTEN (target->decl))
     return false;
 
+  /* If target is already placed in an anchor, we can not touch its
+     alignment.  */
+  if (DECL_RTL_SET_P (target->decl)
+      && MEM_P (DECL_RTL (target->decl))
+      && SYMBOL_REF_HAS_BLOCK_INFO_P (XEXP (DECL_RTL (target->decl), 0)))
+    return false;
+
   /* Constant pool entries may be shared.  */
   if (DECL_IN_CONSTANT_POOL (target->decl))
     return false;