Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: Should optimizing compilers automatically assign registers? Message-ID: <3310@auspex.auspex.com> Date: 6 May 90 19:21:19 GMT References: <512@hhb.UUCP> Organization: Auspex Systems, Santa Clara Lines: 13 The answer to the question "why doesn't -O assign things to register automatically" is "-O means different things on different systems". Prior to SunOS 4.0, Sun didn't have an optimizing compiler for C on the 68K that would assign variables to registers for you; 4.0 has such a compiler, but you have to say "-O2" or higher to get that level of optimization; "-O" is equivalent to "-O1". The SPARC compiler gives you "-O2" when you say "-O". (In SunOS 4.1, "-O" means "-O2" on both 68K and SPARC.) Presumably, for the other machines where "p" wasn't put into a register automatically, either the compiler won't do that for you, or you have to ask for it with more than just "-O".