]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
varasm.c (use_blocks_for_decl_p): Check symbol table instead of alias attribute.
authorJan Hubicka <hubicka@ucw.cz>
Sun, 8 Jun 2014 16:53:25 +0000 (18:53 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 8 Jun 2014 16:53:25 +0000 (16:53 +0000)
* varasm.c (use_blocks_for_decl_p): Check symbol table instead of alias
attribute.
(place_block_symbol): Recurse on aliases.

From-SVN: r211357

gcc/ChangeLog
gcc/varasm.c

index c7767ed87c6758ac4be8f1505b74664364d80ccd..5e5a3c60fc7d0f620af5c30e035b65a114a25c8a 100644 (file)
@@ -1,3 +1,9 @@
+2014-06-07  Jan Hubicka  <hubicka@ucw.cz>
+
+       * varasm.c (use_blocks_for_decl_p): Check symbol table instead of alias
+       attribute.
+       (place_block_symbol): Recurse on aliases.
+
 2014-06-07  Jan Hubicka  <hubicka@ucw.cz>
 
        * ipa-visibility.c: Include varasm.h
index 375838ad9f5bcb15fd49ecf419105e339288ca53..eabc06ff5f725cf05d19df71e96677e40c919a4d 100644 (file)
@@ -1184,6 +1184,8 @@ change_symbol_block (rtx symbol, struct object_block *block)
 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 @@ use_blocks_for_decl_p (tree decl)
 
   /* 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 @@ place_block_symbol (rtx symbol)
       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;
        }