varasm.c (use_blocks_for_decl_p): Check symbol table instead of alias attribute.

* varasm.c (use_blocks_for_decl_p): Check symbol table instead of alias
	attribute.
	(place_block_symbol): Recurse on aliases.

From-SVN: r211357
This commit is contained in:
Jan Hubicka 2014-06-08 18:53:25 +02:00 committed by Jan Hubicka
parent 94c2e46ca3
commit 684a3aa7ab
2 changed files with 13 additions and 1 deletions

View 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

View 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;
}