Re: Tail call optimization
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Wed, 22 Jun 2005 16:00:22 -0500
On Thu, 23 Jun 2005 08:27:43 +1200, Andrew Ward wrote:
> Andrew Ward wrote:
>> Hi All,
>> Could someone please tell me at what optimization level cl will produce
>> optimized tail calls for recursive functions? I.e, no stack growth.
>>
>> Thanks
>
> After a few simple tests with VC++ 7.1 it seems that tail call
> optimizations are not performed at all, even at -Ox optimization level.
> How then are you to supposed to write tail called recursive functions
> that operate over large data sets without getting a stack overflow?
Do what an optimizer does and turn it into a loop or use a goto. In any
event, relying on an optimizer to save you from stack overflow is not a
good plan.
--
Doug Harrison
Microsoft MVP - Visual C++
.
- Follow-Ups:
- Re: Tail call optimization
- From: Andrew Ward
- Re: Tail call optimization
- References:
- Tail call optimization
- From: Andrew Ward
- Re: Tail call optimization
- From: Andrew Ward
- Tail call optimization
- Prev by Date: Re: Tail call optimization
- Next by Date: Re: Programmatically change System Default Language
- Previous by thread: Re: Tail call optimization
- Next by thread: Re: Tail call optimization
- Index(es):
Relevant Pages
|