help-3dldf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[help-3dldf] Re: [metapost] recursion in MP/ MF [was: all intersections


From: Lars Engebretsen
Subject: [help-3dldf] Re: [metapost] recursion in MP/ MF [was: all intersections between two paths]
Date: Tue, 18 Jan 2005 09:31:26 +0100

mån 2005-01-17 klockan 23:09 +0100 skrev Laurence Finston:
> Hello,
> 
> I made the following experiment to test whether GCC 
> (the GNU Compiler Collection) would optimize recursive 
> function calls such that tail recursion would be performed.
> The results of the experiment indicate that it does not.  
> I have tried to make the program as good a candidate as 
> possible for this, but perhaps I'm missing something.
> If so, I'd appreciate it if someone would put me straight.

It could depend on the backend. I'm not an expert in SPARC
assembler, but it seems that with that back end, the stack frame
for the current recursive call is removed during the delay slot
corresponding to the next recursive function call.

I generated the assembler code with 

g++ -S -foptimize-sibling-calls testrcrs.cc

using gcc 3.4.2.

    /Lars





reply via email to

[Prev in Thread] Current Thread [Next in Thread]