This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Quo vadis, thunk? (Was: Re: [PATCH/RFA] PR target/16665: SH thunk
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Joern Rennecke <joern dot rennecke at superh dot com>
- Cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Date: Tue, 03 Aug 2004 09:11:58 -0700
- Subject: Re: Quo vadis, thunk? (Was: Re: [PATCH/RFA] PR target/16665: SH thunk
- Organization: CodeSourcery, LLC
- References: <200408031243.i73Ch4U08271@chloe.uk.w2k.superh.com>
Joern Rennecke wrote:
Thus, I would consider the fact that G++ presently makes the thunks weak
even when the underlying function is not weak to be an odd quirk, if not
a bug. I think that could safely be changed without endangering
anything. It may be that it is the way it is for historical reasons; it
could also be that until my recent linkage cleanup, one could not be
sure whether the associated function would be COMDAT or not. In any
case, I think you could change it now.
I see that use_thunk has now another call to comdat_linkage, so changing
things beforehand would be no good.
I changed the code in use_thunk to be more thorough in making the thunk
agree with the function. (If you think all this adjusting of the thunk
can migrate to make_thunk, that is really a separate issue.)
In fact, I think that all of this ought to migrate to
import_export_decl; that's the function that's responsible for
determining whether things are COMDAT or not. But, as you say, this is
a separate issue.
What kind of testing would this patch require?
First, show that it works: have tests with virtual functions (a) in
COMDAT, and (b) in a named section, and show that in both cases you get
the thunk in the same section. Second, test on a major platform
(GNU/Linux, OS X, Solaris, ...) and show that you get no regressions.
I think it should be OK if those tests pass.
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com