This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch c++/16030] Use RTL name when setting local aliases for thunks
- From: Danny Smith <danny_smith_0000 at yahoo dot co dot nz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 7 Jul 2004 11:24:58 +1200 (NZST)
- Subject: [Patch c++/16030] Use RTL name when setting local aliases for thunks
The attached patch to cp/method.c fixes problems when using local thunk
aliases for functions that have been decorated by
targetm.encode_section_info.
I noticed the problem with stdcall symbols on win32 target. The use of
DECL_ASSEMBLER_NAME for the alias target would result in warnings (or
errors) of the form:
> Warning: resolving D1::vf() const by linking to D1::vf() const@4
> Use --enable-stdcall-fixup to disable these warnings
> Use --disable-stdcall-fixup to disable these fixups
when linking code from the testcase in the PR.
Other targets that encode the RTL name of the symbol (darwin, arm) may
hit similar problems.
Bootstrapped and regtested on i686-pc-mingw32
Danny
cp/ChangeLog
2004-07-07 Danny Smith <dannysmith@users.sourceforge.net>
PR c++/16030
* method.c (make_alias_for_thunk): Use the RTL name rather
than DECL_ASSEMBLER_NAME to assemble alias.
Index: method.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/method.c,v
retrieving revision 1.293
diff -c -3 -p -r1.293 method.c
*** method.c 4 Jul 2004 19:41:32 -0000 1.293
--- method.c 6 Jul 2004 22:45:58 -0000
*************** make_alias_for_thunk (tree function)
*** 300,306 ****
SET_DECL_ASSEMBLER_NAME (alias, DECL_NAME (alias));
TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (alias)) = 1;
if (!flag_syntax_only)
! assemble_alias (alias, DECL_ASSEMBLER_NAME (function));
return alias;
}
--- 300,315 ----
SET_DECL_ASSEMBLER_NAME (alias, DECL_NAME (alias));
TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (alias)) = 1;
if (!flag_syntax_only)
! {
! /* Using DECL_ASSEMBLER_NAME to get the identifier for the alias
! target loses any decoration that targetm.encode_section_info
! may have added. Use the RTL string instead. */
! rtx rtlname = DECL_RTL (function);
! my_friendly_assert (GET_CODE (rtlname) == MEM, 20040707);
! rtlname = XEXP (rtlname, 0);
! my_friendly_assert (GET_CODE (rtlname) == SYMBOL_REF, 20040707);
! assemble_alias (alias, get_identifier (XSTR (rtlname, 0)));
! }
return alias;
}
Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com