Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!ub!uhura.cc.rochester.edu!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!WOOZLE.GRAPHICS.CS.CMU.EDU!spot From: spot@WOOZLE.GRAPHICS.CS.CMU.EDU (Scott Draves) Newsgroups: comp.arch Subject: Re: Optimal Computer Architectures Message-ID: <1990Nov11.102907.7706@cs.cmu.edu> Date: 11 Nov 90 10:29:07 GMT References: <212412@<1990Nov8> <3300209@m.cs.uiuc.edu> <334@mentat.COM> Sender: netnews@cs.cmu.edu (USENET News Group Software) Reply-To: spot@WOOZLE.GRAPHICS.CS.CMU.EDU (Scott Draves) Organization: Carnegie Mellon University Lines: 34 In article <334@mentat.COM>, blc@mentat.COM (Bruce Carneal) writes: |> Hopefully the newer compilers |> for the SPARC do/will handle tail calls without stack |> growth. It is my understanding that the SunOS 4.x compiler does detect and eliminate tail recursion. This is verified by compiling (-O4 -S) ENUM(i) { if (i==0) return 1; else return ENUM(i-1); } and seeing _ENUM: L77001: tst %o0 bne L77003 nop retl add %g0,1,%o0 L77003: b L77001 dec %o0 It seems odd that it would generate a branch to another branch. can anyone who knows comment? Consume Scott Draves Be Silent spot@cs.cmu.edu Die