This is the mail archive of the gcc-patches@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: [PATCH] Also optimize DECL_ONE_ONLY cdtors (PR c++/3187)


On Wed, Nov 18, 2009 at 11:24:18AM -0500, Jason Merrill wrote:
> On 11/18/2009 04:39 AM, Jakub Jelinek wrote:
>> There is no such thing as alias from one section to another, alias in ELF
>> is just another symbol for the same thing as certain symbol, so it always
>> has the same section and value as the other symbol.
>
> Ah, right.
>
> What if we just make one jump to the other?

That is only possible on some targets (the ones that allow to do a tail call
to that kind of function), on other targets you'd need to call it and return
and in case of ... arguments just give up.  It would also be more expensive
at runtime, the call takes some cycles.

But most importantly, the jump/call would essentially become part of the
ABI.  Because if say G++ 4.5 decides it jumps from *D1* to *D2* and some other
compiler decides to jump from *D2* to *D1*, then if the linker chooses
*D1* comdat group compiled by G++ 4.5 and *D2* comdat group compiled by the
* other compiler, those routines will jump to each other in an endless loop.

	Jakub


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