re PR ipa/61548 (FAIL: gcc.dg/tls/alias-1.c)

PR ipa/61548
	* tree-emutls.c (ipa_lower_emutls): Avoid duplicates in TLS_VARS.

From-SVN: r220549
This commit is contained in:
Jan Hubicka 2015-02-09 22:06:35 +01:00 committed by Jan Hubicka
parent 106b546664
commit 6248441777
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2015-02-08 Jan Hubicka <hubicka@ucw.cz>
PR ipa/61548
* tree-emutls.c (ipa_lower_emutls): Avoid duplicates in TLS_VARS.
2015-02-08 Jan Hubicka <hubicka@ucw.cz>
PR ipa/63566

View File

@ -753,17 +753,19 @@ ipa_lower_emutls (void)
cgraph_node *func;
bool any_aliases = false;
tree ctor_body = NULL;
hash_set <varpool_node *> visited;
auto_vec <varpool_node *> tls_vars;
/* Examine all global variables for TLS variables. */
FOR_EACH_VARIABLE (var)
if (DECL_THREAD_LOCAL_P (var->decl))
if (DECL_THREAD_LOCAL_P (var->decl)
&& !visited.add (var))
{
gcc_checking_assert (TREE_STATIC (var->decl)
|| DECL_EXTERNAL (var->decl));
tls_vars.safe_push (var);
if (var->alias && var->definition)
if (var->alias && var->definition
&& !visited.add (var->ultimate_alias_target ()))
tls_vars.safe_push (var->ultimate_alias_target ());
}