Tail call optimization?

Alex Rønne Petersen xtzgzorex at gmail.com
Mon Mar 19 05:16:27 PDT 2012


On 19-03-2012 13:07, bearophile wrote:
> Stewart Gordon:
>
>> What are "normal cases"?
>
> It means "very simple cases". Things like fibonacci / factorial functions that call themselves at the tail.
>
> Generally it's a fragile optimization, it's easy for it to not work/stop working. LLVM used to perform this optimization, then it stopped working for months an no one noticed. I have written a bug report and they have made it work again. And then they have put it in their demo :-)
> http://llvm.org/demo/
>
> Bye,
> bearophile

I still don't understand why compilers don't just provide *guaranteed, 
well-defined* tail calls when the emitted IR demands it... this whole 
"it may or may not be TCO'd" business is ridiculous.

-- 
- Alex


More information about the Digitalmars-d-learn mailing list