This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]