[fpc-devel] Stackframes

Michael Van Canneyt michael at freepascal.org
Sat Aug 27 14:04:14 CEST 2011



On Sat, 27 Aug 2011, Florian Klämpfl wrote:

> Am 27.08.2011 12:50, schrieb Michael Van Canneyt:
>>
>>
>> On Sat, 27 Aug 2011, Ludo Brands wrote:
>>
>>> In
>>> http://www.freepascal.org/docs-html/prog/progsu72.html#x78-770001.1.72 is
>>> written:
>>>
>>> ...
>>> the compiler will omit the generation of a stackframe if the following
>>> conditions are satisfied:
>>>
>>>    The procedure has no parameters.
>>> ...
>>>
>>> This condition should read: The procedure has no parameters on the stack.
>>> Parameters passed in registers do not trigger stackframe generation.
>>>
>>> There are a lot of wrapper functions, with register only parameters,
>>> in the
>>> rtl and elsewhere that don't generate stack frames.
>>
>> If the compiler developers can confirm this, then I'll adapt the
>> documentation.
>
> Find some generic text aiming on complexity or whatever :) The rules
> when it happens or not are pretty complex, they also depend on the
> target architecture. See e.g. psub.pas:953+ and all occurences of
> pi_needs_stackframe in the compiler

I knew I should ask confirmation, I will adapt the docs to be more careful ;-)

Michael.


More information about the fpc-devel mailing list