Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!POSTGRES.BERKELEY.EDU!dillon From: dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga Subject: Re: Amiga compiler optimizing test Message-ID: <8903051103.AA00179@postgres.Berkeley.EDU> Date: 5 Mar 89 11:03:40 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 18 >Why would an optimizing compiler put `link a5, 0000' and 'unlnk a5' >instructions into a subroutine that needed no local variables? (1) So A5 can be used to referenced arguments (2) So a debugger can backtrace the stack frame. Apart from that, there is no reason to use link/unlk at all. If you want to talk about optimization, one can cut the call-return overhead by half or more by: (1) caller passes the return address in a register and jmp's or bra's to the routine instead of jsr'ing (2) callee pops caller's arguments (it can pop the args and free up its own stack (local vars) in one instruction.. an add). -Matt