aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-symtab.c
diff options
context:
space:
mode:
authorDave Korn <dave.korn.cygwin@gmail.com>2010-12-10 14:28:58 +0000
committerDave Korn <davek@gcc.gnu.org>2010-12-10 14:28:58 +0000
commit77754180a97af78b7b330bdabc7072e1f1da07e6 (patch)
treecb0845f24d59969509e47111a1b3af34cd9b8773 /gcc/lto-symtab.c
parent4816c5938dfb6d9510b43f9223dab24af530e00e (diff)
downloadgcc-77754180a97af78b7b330bdabc7072e1f1da07e6.zip
gcc-77754180a97af78b7b330bdabc7072e1f1da07e6.tar.gz
gcc-77754180a97af78b7b330bdabc7072e1f1da07e6.tar.bz2
re PR middle-end/46674 (Weak alias is mistakenly optimized away)
gcc/ChangeLog: PR middle-end/46674 PR lto/43157 * target.def (mangle_assembler_name): New target asm_out hook. * targhooks.c (default_mangle_assembler_name): Add default hook implementation. * targhooks.h (default_mangle_assembler_name): Add prototype. * lto-symtab.c (lto_symtab_register_decl): Use new hook when processing DECL_ASSEMBLER_NAMEs for lto symtabs. (lto_symtab_get_resolution): Likewise. (lto_cgraph_replace_node): Likewise. (lto_symtab_prevailing_decl): Likewise. * lto-streamer-out.c (write_symbol): Likewise. * doc/tm.texi.in (TARGET_MANGLE_ASSEMBLER_NAME): Add @hook directive. * doc/tm.texi: Regenerate. * config/i386/cygming.h (TARGET_MANGLE_ASSEMBLER_NAME): Define to point at i386_pe_mangle_assembler_name. * config/i386/winnt.c (i386_pe_mangle_assembler_name): New function. * config/i386/i386-protos.h (i386_pe_mangle_assembler_name): Add prototype. lto-plugin/ChangeLog: PR middle-end/46674 PR lto/43157 * configure.ac (SYM_STYLE): Don't AC_DEFINE. * lto-plugin.c (sym_style): Don't use it; default to ss_none. * configure: Regenerate. * config.h.in: Likewise. gcc/testsuite/ChangeLog: PR middle-end/46674 PR lto/43157 * gcc.dg/pr43157.c: New file. From-SVN: r167688
Diffstat (limited to 'gcc/lto-symtab.c')
-rw-r--r--gcc/lto-symtab.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index dbdbcb2..c86bbcc 100644
--- a/gcc/lto-symtab.c
+++ b/gcc/lto-symtab.c
@@ -155,7 +155,8 @@ lto_symtab_register_decl (tree decl,
gcc_assert (!DECL_ABSTRACT (decl));
new_entry = ggc_alloc_cleared_lto_symtab_entry_def ();
- new_entry->id = DECL_ASSEMBLER_NAME (decl);
+ new_entry->id = (*targetm.asm_out.mangle_assembler_name)
+ (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
new_entry->decl = decl;
new_entry->resolution = resolution;
new_entry->file_data = file_data;
@@ -190,7 +191,8 @@ lto_symtab_get_resolution (tree decl)
gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl));
- e = lto_symtab_get (DECL_ASSEMBLER_NAME (decl));
+ e = lto_symtab_get ((*targetm.asm_out.mangle_assembler_name)
+ (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))));
while (e && e->decl != decl)
e = e->next;
if (!e)
@@ -218,7 +220,8 @@ lto_cgraph_replace_node (struct cgraph_node *node,
cgraph_node_name (node), node->uid,
cgraph_node_name (prevailing_node),
prevailing_node->uid,
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl)));
+ IDENTIFIER_POINTER ((*targetm.asm_out.mangle_assembler_name)
+ (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl)))));
}
if (prevailing_node->same_body_alias)
@@ -836,7 +839,8 @@ lto_symtab_prevailing_decl (tree decl)
gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl));
/* Walk through the list of candidates and return the one we merged to. */
- ret = lto_symtab_get (DECL_ASSEMBLER_NAME (decl));
+ ret = lto_symtab_get ((*targetm.asm_out.mangle_assembler_name)
+ (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))));
if (!ret)
return NULL_TREE;