Path: utzoo!utgpu!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!agate!ucbvax!decwrl!purdue!bu-cs!mirror!ima!haddock!suitti From: suitti@haddock.ima.isc.com (Stephen Uitti) Newsgroups: comp.sys.mac.programmer Subject: Re: (was) serious code generation bug in Lightspeed C Message-ID: <11494@haddock.ima.isc.com> Date: 23 Jan 89 19:14:40 GMT References: <1112@dogie.edu> <6337@hoptoad.uucp> <5623@phoenix.Princeton.EDU> Reply-To: suitti@haddock.ima.isc.com (Stephen Uitti) Organization: Interactive Systems, Boston Lines: 35 In article <5623@phoenix.Princeton.EDU> mbkennel@phoenix.Princeton.EDU (Matthew B. Kennel) writes: >In article <6337@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: >>In article <1112@dogie.edu> yahnke@vms.macc.wisc.edu (Ross Yahnke, MACC) writes: >>>[misc flames & rude comments]. >>[replies with references] >An intelligent C compiler should perform this optimization automatically, >i.e. reduction of common subexpressions. > >PS: this is my personal gripe.... >Why does LSC generate such LAME code? Does it optimize ANYTHING? > >Sorry to be so disrespectful of an otherwise fine product, but the code >generator is definitely NOT up to contemporary standards, even on >microcomputers. > >(what do you mean? Port gcc onto a Mac 128? No problem!) :) Some time ago, I ran some C benchmarks on a Mac II & Sun III. Both machines have 68020's, the SUN ran at 20 MHz, the Mac II at 15.something. LSC 2.15 vs the standard Sun "cc". Optimization flags were used on the Sun. The Mac tended to have run times that were very close to those of the Sun, with some run times actually faster than the Sun. Compilation speed is also tremendously greater. Compilation speed of Turbo C for a 7.16 MHz XT clone is more than three times faster than a VAX. "Even on microcomputers" is incorrect. The compilers for PCs and Macs are MUCH better than for larger machines. It even makes sense. There is more money in it. Would gcc be better than LSC? Well, gcc would never produce code as quickly, gdb would never be as nice as LSC 3.0, you'd need "make", etc. The code *might* be as fast as LSC's code. It probably wouldn't be as fast, since one would probably make int's 32 bits. Stephen.