[fpc-devel] Re: Bug in revision 9781/2

Daniël Mantione daniel.mantione at freepascal.org
Sat Jan 19 16:24:06 CET 2008



Op Sat, 19 Jan 2008, schreef Jonas Maebe:

>
> On 19 Jan 2008, at 15:54, Peter Vreman wrote:
>
>> This call and pop is old-style PIC and not good for new cpus because it 
>> breaks the call-stack. Please use the new style that calls a function 
>> (fpc_geteipasebx). This also generated by the compiler. See i386/cgcpu.pas 
>> and search for g_maybe_got_init.
>
> I recently read that on the more recent processors, call/pop is slightly 
> faster again (I suppose they detect a call to next instruction and don't add 
> it to the internal call stack or so).
>
> http://lists.apple.com/archives/perfoptimization-dev/2007/Nov/msg00005.html

Intel cpu's since Pentium M and AMD cpu's since Barcelona indeed have a 
stack analyzer. I'm still going to switch back to the fpc_geteipasebx 
helper since the extra call/ret penalty on those processors is small while 
the penalty of a broken call stack is large.

Daniël


More information about the fpc-devel mailing list