lto-symtab.c (lto_symtab_merge_cgraph_nodes): Merge alias decl of thunks.
authorJan Hubicka <jh@suse.cz>
Tue, 31 May 2011 14:15:17 +0000 (16:15 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 31 May 2011 14:15:17 +0000 (14:15 +0000)
* lto-symtab.c (lto_symtab_merge_cgraph_nodes): Merge alias decl
of thunks.

From-SVN: r174482

gcc/ChangeLog
gcc/lto-symtab.c

index c416db5273016d66876304d114df70b5f819302e..86a288a631d4b6469b74c4c842e502fb7ce913ce 100644 (file)
@@ -1,3 +1,8 @@
+2011-05-31  Jan Hubicka  <jh@suse.cz>
+
+       * lto-symtab.c (lto_symtab_merge_cgraph_nodes): Merge alias decl
+       of thunks.
+
 2011-05-31  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/49235
index 8dc10e8e6c5ce25ff60c76b399b4cfce25c04a63..af8106de94f2586457820c5059690103951d366f 100644 (file)
@@ -821,11 +821,15 @@ lto_symtab_merge_cgraph_nodes (void)
   htab_traverse (lto_symtab_identifiers, lto_symtab_merge_cgraph_nodes_1, NULL);
 
   for (node = cgraph_nodes; node; node = node->next)
-    for (alias = node->same_body; alias; alias = next)
-      {
-       next = alias->next;
-       alias->thunk.alias = lto_symtab_prevailing_decl (alias->thunk.alias);
-      }
+    {
+      if (node->thunk.thunk_p)
+        node->thunk.alias = lto_symtab_prevailing_decl (node->thunk.alias);
+      for (alias = node->same_body; alias; alias = next)
+       {
+         next = alias->next;
+         alias->thunk.alias = lto_symtab_prevailing_decl (alias->thunk.alias);
+       }
+    }
 }
 
 /* Given the decl DECL, return the prevailing decl with the same name. */