diff options
author | Jan Hubicka <jh@suse.cz> | 2011-03-04 19:49:23 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2011-03-04 18:49:23 +0000 |
commit | 87e7b310b3ddd203c446233d1517358e3708d9d7 (patch) | |
tree | a02cdefa6ac453edbd6d7e2b499c42469f9df485 /gcc/lto-symtab.c | |
parent | d9c642462049486d1dbf560686723313193baf43 (diff) | |
download | gcc-87e7b310b3ddd203c446233d1517358e3708d9d7.zip gcc-87e7b310b3ddd203c446233d1517358e3708d9d7.tar.gz gcc-87e7b310b3ddd203c446233d1517358e3708d9d7.tar.bz2 |
re PR lto/47497 (SPEC CPU 2006 failed to link with LTO -fuse-linker-plugin -fwhole-program)
PR lto/47497
* lto-symtab.c (lto_cgraph_replace_node): Do not set thunk.alias.
(lto_symtab_merge_cgraph_nodes_1): Update thunk.alias pointers here.
* cgraph.h (cgraph_same_body_alias, cgraph_add_thunk): Add node pointers.
* cgraph.c (cgraph_same_body_alias_1, cgraph_same_body_alias,
cgraph_add_thunk): Add node pointers.
* lto-cgraph.c (lto_output_node): Verify that thunks&aliases are
associated to right node.
(input_node): Update use of cgraph_same_body_alias
and cgraph_add_thunk.
* optimize.c (maybe_clone_body): Update call of cgraph_same_body_alias
and cgraph_add_thunk.
* method.c (make_alias_for_thunk, use_thunk): Likewise.
* mangle.c (mangle_decl): Likewise.
From-SVN: r170682
Diffstat (limited to 'gcc/lto-symtab.c')
-rw-r--r-- | gcc/lto-symtab.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index 7573276..b02aaba 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -273,7 +273,6 @@ lto_cgraph_replace_node (struct cgraph_node *node, last = alias; gcc_assert (alias->same_body_alias); alias->same_body = prevailing_node; - alias->thunk.alias = prevailing_node->decl; } last->next = prevailing_node->same_body; /* Node with aliases is prevailed by alias. @@ -828,8 +827,16 @@ lto_symtab_merge_cgraph_nodes_1 (void **slot, void *data ATTRIBUTE_UNUSED) void lto_symtab_merge_cgraph_nodes (void) { + struct cgraph_node *node, *alias, *next; lto_symtab_maybe_init_hash_table (); 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); + } } /* Given the decl DECL, return the prevailing decl with the same name. */ |