Path: utzoo!attcan!uunet!husc6!ukma!gatech!mcnc!rti!sas!toebes From: toebes@sas.UUCP (John Toebes) Newsgroups: comp.sys.amiga Subject: Re: C versus Assembly, which one? Message-ID: <554@sas.UUCP> Date: 20 Jun 88 04:57:20 GMT References: <1968@uhccux.uhcc.hawaii.edu> <4508@killer.UUCP> Reply-To: toebes@sas.UUCP (John Toebes) Organization: SAS Institute Inc, Cary NC Lines: 43 In article <4508@killer.UUCP> elg@killer.UUCP (Eric Green) writes: >On a related topic, does the Lattice 4.0 compiler do any (useful) >optimizations besides common subexpression? In particular, some of the RISC >compilers generate code that keep calculated addresses around, and all of the >RISC compilers seem to make every attempt to keep most-common-used variables >in registers (in fact, the Pyramid 90x compiler totally ignores the "register" >declarators, as far as I can tell -- at least, when you have fewer than 16 >local variables and 16 parameters). > >I've been looking at the code generated by the Manx 3.60 compiler, and it >looks pretty simplistic. Does Lattice 4.0 manage any better? > The Lattice 4.0 compiler has a fairly complex code generation scheme with both a forward and backward look at the code being processed. It performs: a) Common sub-expression elimination (over more than a simple basic block) b) dead code elimination (usually :-) c) Register tracking d) Condition code tracking e) conversion compression (int=>short = short=>int + short=>int as short = short+short) f) Optimized builtin functions g) common string elimination h) constant folding i) branch to branch supression j) indexing subsumption k) [my favorite because I thought it up] forward register merging across if/then/else statements and other nonsense. In addition, there is quite a bit of analysys involved with register tracking and selection making it much more complex than a simplistic pattern matching code generator often found with PCC and its derivatives. (No cut intended) Even with all it does currently, I am not yet satisfied (maybe I will never be) so this list constantly grows. >(& onrelated topic, SDB gurus my machine regularly, sigh). Have you called their tech support? That's what you pay for when you get a language product. >Eric Lee Green ..!{ames,decwrl,mit-eddie,osu-cis}!killer!elg /*---------------------All standard Disclaimers apply---------------------*/ /*----Working for but not officially representing SAS or Lattice Inc.-----*/ /*----John A. Toebes, VIII usenet:...!mcnc!rti!sas!toebes-----*/ /*------------------------------------------------------------------------*/