Xref: utzoo comp.sys.amiga:30383 comp.sys.amiga.tech:4063 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!oliveb!amiga!cbmvax!jesup From: jesup@cbmvax.UUCP (Randell Jesup) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: Amiga compiler optimizing test Message-ID: <6184@cbmvax.UUCP> Date: 9 Mar 89 02:10:58 GMT References: <3531@sdsu.UUCP> <3839@tekig5.PEN.TEK.COM> <462@laic.UUCP> Reply-To: jesup@cbmvax.UUCP (Randell Jesup) Followup-To: comp.sys.amiga.tech Organization: Commodore Technology, West Chester, PA Lines: 19 In article <462@laic.UUCP> darin@nova.UUCP (Darin Johnson) writes: >In article <3839@tekig5.PEN.TEK.COM> brianr@tekig5.PEN.TEK.COM (Brian Rhodefer) writes: >>Why would an optimizing compiler put `link a5, 0000' and 'unlnk a5' >>instructions into a subroutine that needed no local variables? ... >2) Because it's simple. Otherwise compilers would have to backpatch >the generated code. If it was determined later that the routine >didn't need a link/unlnk, then it would have to remove that instruction, >shuffle things around, etc. This isn't that difficult, but a lot of >compilers don't do it. I see this the most on UN*X systems, whose >compilers were derived from PCC. Usually, the code generated is something Lattice will not normally put in LINK #0,An's if the optimizer is turned on. Otherwise it will, for debugger support (debuggers usually use LINKs to find the stack frames.) However, there are some cases where LINK #0 will still be generated. -- Randell Jesup, Commodore Engineering {uunet|rutgers|allegra}!cbmvax!jesup