This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][LTO] Fix thunks with LTO
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jan Hubicka <jh at suse dot de>, Diego Novillo <dnovillo at google dot com>
- Date: Thu, 3 Dec 2009 14:53:14 +0100 (CET)
- Subject: [PATCH][LTO] Fix thunks with LTO
This fixes an oversight in emitting thunks which should use
DECL_ASSEMBLER_NAME for the entry point (which can get re-mangled
from LTO if the symbol is local due to being in an anonymous
namespace).
Bootstrap and regtest ongoing, it at least fixes
g++.dg/lto/20090106_0.C. I'll do a SPEC build as sanity test as well.
Ok if that passes?
Thanks,
Richard.
2009-12-03 Richard Guenther <rguenther@suse.de>
* cgraphunit.c (assemble_thunk): Use DECL_ASSEMBLER_NAME
instead of DECL_NAME for the entry point.
Index: gcc/cgraphunit.c
===================================================================
*** gcc/cgraphunit.c (revision 154941)
--- gcc/cgraphunit.c (working copy)
*************** assemble_thunk (struct cgraph_node *node
*** 1321,1327 ****
DECL_RESULT (thunk_fndecl)
= build_decl (DECL_SOURCE_LOCATION (thunk_fndecl),
RESULT_DECL, 0, integer_type_node);
! fnname = IDENTIFIER_POINTER (DECL_NAME (thunk_fndecl));
/* The back end expects DECL_INITIAL to contain a BLOCK, so we
create one. */
--- 1321,1327 ----
DECL_RESULT (thunk_fndecl)
= build_decl (DECL_SOURCE_LOCATION (thunk_fndecl),
RESULT_DECL, 0, integer_type_node);
! fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
/* The back end expects DECL_INITIAL to contain a BLOCK, so we
create one. */