Christian Bau wrote:
> In article <>,
> Michael Mair <> wrote:
>
>
>>Please quote enough context when replying to a message -- otherwise,
>>people who could give you a good answer if they had the necessary
>>context cannot do so.
>>
>>Aloo wrote:
>>[inlining of recursive functions into iterations?]
>>
>>>The code compiles succesfully, but does the compiler know at compile
>>>time at how many places to insert the code, since the number of times
>>>the code executes depends upon the input at runtime.
>>
>>Well, there are three possibilities for the special case of everything
>>known at compile time:
>>1) The compiler ignored the "inline". This is easiest, thus the most
>>probable course.
>>2) The compiler replaced the body of the function by an equivalent
>>iteration and had to inline only once.
>>3) The compiler figured out the necessary recursion depth for each and
>>every call and inserted appropriately many calls. This is the most
>>unlikely.
>
> Another one: The compiler can generate a function body which inlines up
> to a depth of say four, then calls that function body recursively if
> necessary. Doing this would eliminate 75% of all the function calls,
> while still easy to implement.
Thank you -- did not think of that
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.