This is the mail archive of the gcc@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]

Re: Quo vadis, thunk? (Was: Re: [PATCH/RFA] PR target/16665: SH thunk


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


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