Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!cernvax!chx400!chx400!sicsun!disuns2!gay_d From: gay_d@disuns2.epfl.ch (David Gay) Newsgroups: comp.sys.amiga.programmer Subject: Re: Lemmings - a tutorial Part V (last) Message-ID: <1813@disun4.epfl.ch> Date: 1 Apr 91 14:16:53 GMT References: <1991Mar31.003933.1483@mintaka.lcs.mit.edu> <1991Apr1.020748.26863@mintaka.lcs.mit.edu> Reply-To: gay_d@3/16/89{MAILDOMAIN-.litsun2.ch} (David Gay) Organization: Ecole Polytechnique Federale de Lausanne Lines: 47 In article mykes@amiga0.SF-Bay.ORG (Mike Schwartz) writes: rjc@geech.gnu.ai.mit.edu (Ray Cromwell) writes: < <> Obviously you have no idea of how advanced today's optimizing compilers <>are. The code you stepped through must have been produced by some <>1970's MetaComco compiler or something. But FYI, most of todays compilers <>can pass arguements in registers, allocate memory without stack, eliminate <>the frame registers, and even do all the non-obvious tricks of sign extension, <>etc. Check out the code I've included at the end compiled by GCC. <> <>The following was compiled with GCC -O -fstrength-reduce -fomit-frame-register <>I don't have SAS C on the Amiga, but I'm sure it produces simular results. <> <>/* test.c */ <> <>char buf[20]; <>main() <>{ <> char *d=(char *)&buf; <> const char *s="This is a test\n"; <> while(*s) { *d++=*s++; } <>} [Code deleted to satisfy inews, sorry]