From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,170d8c9368cab115 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit From: Brian May Newsgroups: comp.lang.ada Subject: Re: Tail Recursion (Why it appears that Gnat 3.15p does support it) References: <1105653887.848989.268410@z14g2000cwz.googlegroups.com> <1105718811.554008.197490@z14g2000cwz.googlegroups.com> Date: Sat, 15 Jan 2005 16:08:35 +1100 Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:3HquSNn86BFASQ7bA0/znklkF4I= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: snoopy.microcomaustralia.com.au X-Trace: news.melbourne.pipenetworks.com 1105765684 202.173.153.89 (15 Jan 2005 15:08:04 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news4.google.com!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!news1.optus.net.au!optus!news.mel.connect.com.au!news-north.connect.com.au!news.alphalink.com.au!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:7795 Date: 2005-01-15T16:08:35+11:00 List-Id: >>>>> "wojtek" == wojtek writes: wojtek> GNAT does not optimize tail calls, because, AFAIK, the wojtek> underlying GCC does not. My copy of the *man* page (which may be wrong) has: -mtail-call -mno-tail-call Do (or do not) make additional attempts (beyond those of the machine-independent portions of the compiler) to optimize tail- recursive calls into branches. You may not want to do this because the detection of cases where this is not valid is not totally com- plete. The default is -mno-tail-call. So, to the original poster, try -mtail-call, that might help. The implication is that this might be buggy, but this documentation might be wrong too. I don't have the info documentation currently installed. -- Brian May