From a0cbab4acd8f7af1ece6d94e61d5c754246c5efa Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 5 Feb 2015 05:45:41 +0100 Subject: [PATCH] re PR ipa/61548 (FAIL: gcc.dg/tls/alias-1.c) PR ipa/61548 * tree-emultls.c (new_emutls_decl): Resolve alias after creating it. Co-Authored-By: Trevor Saunders From-SVN: r220434 --- gcc/ChangeLog | 6 ++++++ gcc/tree-emutls.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 29049bd5741..c293971f537 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-02-04 Jan Hubicka + Trevor Saunders + + PR ipa/61548 + * tree-emultls.c (new_emutls_decl): Resolve alias after creating it. + 2015-02-04 Jan Hubicka PR ipa/61548 diff --git a/gcc/tree-emutls.c b/gcc/tree-emutls.c index da03b2a0fca..68b2aae5e70 100644 --- a/gcc/tree-emutls.c +++ b/gcc/tree-emutls.c @@ -366,9 +366,14 @@ new_emutls_decl (tree decl, tree alias_of) else if (!alias_of) varpool_node::add (to); else - varpool_node::create_alias (to, - varpool_node::get_for_asmname - (DECL_ASSEMBLER_NAME (DECL_VALUE_EXPR (alias_of)))->decl); + { + varpool_node *n; + varpool_node *t = varpool_node::get_for_asmname + (DECL_ASSEMBLER_NAME (DECL_VALUE_EXPR (alias_of))); + + n = varpool_node::create_alias (to, t->decl); + n->resolve_alias (t); + } return to; } -- 2.30.2