This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++/i86 thunk patch
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: "rth at redhat dot com" <rth at redhat dot com>
- Date: Mon, 15 Jul 2002 08:04:13 -0700
- Subject: Re: C++/i86 thunk patch
--On Monday, July 15, 2002 09:46:37 AM +0100 Nathan Sidwell
<nathan@codesourcery.com> wrote:
Hi,
this patch implements a new macro ASM_OUTPUT_VMI_THUNK, and
obsoletes ASM_OUTPUT_MI_THUNK. I have implemented that
macro for i86 targets.
The new macro incorporates the 3.0 ABI's vcall offset. The thunk
is passed both the fixed delta and the vcall offset, and it is
This patch is OK for the mainline. Although it is technically a
regression, I do not think it is important enough to put it on the
3.1 branch, and since the change will affect so much code I don't
think we should go further than that.
The new ABI also requires return value adjusting thunks,
for covariant return types. I can't see how to do those without
cloning the thunked function.
You can also have your existing thunk code do a jump to subroutine,
instead of a jump, at the end. Then, when the subroutine returns
you adjust the returned value and return yourself.
Of course, a multiple entry point implementation would be more
efficient. Zack is working on making multiple entry point support
a bit more full-fledged, which will facilitate this down the road.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com