Hi,
this is third part - it fixes handling of aliases in the anchor sections
by recursing in place_block_symbol as discussed and also fixing one case
where we lookup attribute instead of using symbol table

        * varasm.c (use_blocks_for_decl_p): Check symbol table instead of alias
        attribute.
        (place_block_symbol): Recurse on aliases.
Index: varasm.c
===================================================================
--- varasm.c    (revision 211356)
+++ varasm.c    (working copy)
@@ -1184,6 +1184,8 @@
 static bool
 use_blocks_for_decl_p (tree decl)
 {
+  struct symtab_node *snode;
+
   /* Only data DECLs can be placed into object blocks.  */
   if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != CONST_DECL)
     return false;
@@ -1197,7 +1199,9 @@
 
   /* If this decl is an alias, then we don't want to emit a
      definition.  */
-  if (lookup_attribute ("alias", DECL_ATTRIBUTES (decl)))
+  if (TREE_CODE (decl) == VAR_DECL
+      && (snode = symtab_get_node (decl)) != NULL
+      && snode->alias)
     return false;
 
   return targetm.use_blocks_for_decl_p (decl);
@@ -7028,6 +7032,8 @@
       if (snode->alias)
        {
          rtx target = DECL_RTL (symtab_alias_ultimate_target (snode)->decl);
+
+         place_block_symbol (target);
          SYMBOL_REF_BLOCK_OFFSET (symbol) = SYMBOL_REF_BLOCK_OFFSET (target);
          return;
        }

Reply via email to