Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site hou4b.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!ariel!hou4b!mat From: mat@hou4b.UUCP (Mark Terribile) Newsgroups: net.lang.c Subject: Re: Bozos Message-ID: <1357@hou4b.UUCP> Date: Wed, 20-Mar-85 15:35:13 EST Article-I.D.: hou4b.1357 Posted: Wed Mar 20 15:35:13 1985 Date-Received: Thu, 21-Mar-85 04:46:35 EST References: <9194@brl-tgr.ARPA> Organization: AT&T Information Systems Laboratories, Holmdel, NJ Lines: 54 >5) Register variables are a hopeless hack advertised as a feature by > lazy-ass compiler writers. Even when I DO know which variables are > more frequently used, I cannot achieve the same results as a worthwhile > compiler that places a variable in a register only when it really needs > to be there, and then (GASP!) puts SOMETHING ELSE in that same register. >David Chase, Rice University The problem of deciding what to place in fast, easy-to-access registers is dependent on whether you need to optimize for space or speed, on which paths you expect to be be the most frequently executed, etc. When you can show me a compiler that can read the programmer's mind and be clairvoyant as well (to determine what the program's input will be) I will accept your advice. In the mean time, I welcome the chance to give the compiler hints as to what should be made easily addressable, though it would be nice to have it make a try if you don't. If you tell me that space is irrelevant, then I can only assume that your code will be running on machines that you don't buy. If you have to write code for an embedded application, and you expect to sell 100 000 of them, then you are damn well concerned with how little memory you can squeeze your code into. And if you are writing real-time applications, you sure do care about how fast things run. This is not to say that compilers shouldn't be better. They should. Most production compilers have some awful mishandling of some really simple cases. But why shouldn't a compiler be willing to take a little advice? If you want to bellyache, how about the hardware designers who make it easier to address this datum than that datum? Don't bother. There are engineering trade-offs, and unless you've done it once or twice yourself, please don't pontificate. As to sharing registers ... { register struct schmonk schp = exschmonk[ newschmonk ].next; ... } { register int n_widget; ... } 'nuf said? -- from Mole End Mark Terribile (scrape .. dig ) hou4b!mat ,.. .,, ,,, ..,***_*.