Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!ucsd!ucsdhub!hp-sdd!hplabs!cae780!leadsv!laic!nova!darin From: darin@nova.laic.uucp (Darin Johnson) Newsgroups: comp.sys.amiga Subject: Re: C versus Assembly, which one? Message-ID: <264@laic.UUCP> Date: 20 Jun 88 18:34:22 GMT References: <1968@uhccux.uhcc.hawaii.edu> <4508@killer.UUCP> Sender: news@laic.UUCP Lines: 28 In article <4508@killer.UUCP>, elg@killer.UUCP (Eric Green) writes: > 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). This should be a feature of any compiler that optimizes. I have been a teaching assistant for C and compiler classes, and am amazed at the number of people who swear that 'register' is a direct order to the compiler ("Gee, no wonder it doesn't work, you have 17 register variables..."). I was absolutely flabbergasted when I looked at the output of one of the early Lattice compilers (I can't verify since I no longer have it). It would NEVER place automatic variables into registers UNLESS it was declared as 'register' (it would use registers for temporaries, thank heavens). I would also get error messages if I used an excessive amount of register declarations. For the money I paid, I would have expected the compiler to figure out on its own that something could be put into a register without a 'hint'. (Actually, when I wrote a compiler for the Pyramid, I thoroughly tested out the existing C and Pascal assembly outputs. You have to go to a lot of work just to get a variable that isn't in a register!! If the 16 local registers were allocated, it would use any unused parameter registers, etc. etc.) Darin Johnson (...pyramid.arpa!leadsv!laic!darin) (...ucbvax!sun!sunncal!leadsv!laic!darin) "All aboard the DOOMED express!"