Question re: Thunks (was Re: [PATCH] - Fix PR 21956 and PR 22003)

Caroline Tice ctice@apple.com
Mon Aug 1 20:44:00 GMT 2005


On Jul 27, 2005, at 1:55 PM, Richard Henderson wrote:
> On Wed, Jul 27, 2005 at 02:41:08AM +0200, Steven Bosscher wrote:
>
>>     PR c++/22003
>>     * varasm.c (assemble_start_function): Don't do anything that may
>>     require a CFG if the current function is a thunk.
>>
>
> Not entirely ok.  Several of the target backend thunks require that
> the thunk and the function reside in the same section.  Though I
> suspect that this may already be broken by -ffunction-sections, so
> I guess this can probably go in as-is.
>
>
> r~


Hi,

I have a question about this; I've been investigating the interaction
of thunks with hot/cold partitioning (and I know it's not correct at
the moment).  But it appears that thunks always end up in a coalesced
or comdat section, while the main function ends up in a "regular" text
section, orthogonal to whether we're doing partitioning or not.

When partitioning is turned on, it appears at the moment that the
thunk will always default to going into the hot coalesced/comdat
section, without reference to where the main function goes.

Before I can begin to fix this I need to understand better which of
the following options is the correct one.  (Also, I'd like some sense
of how important it is to fix this quickly, as I have other things I'm
supposed to be working on):

1). Thunks are always supposed to be in exactly the same section as the
       main function (in which case this is broken even without  
partitioning), or

1a). Same as 1, AND the section must be coalesced/comdat, or

1b). Same as 1 AND the section must NOT be coalesced/comdat, or

2). Sometimes the thunk should be in the coalesced/comdat section while
       the main function is in the "regular" text section. (if so,  
when), or

2a). Same as 2, but with the added condition that they must both be  
hot or
         both be cold, or

3). Some other scheme

-- Caroline Tice
ctice@apple.com




More information about the Gcc-patches mailing list