Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watmath.UUCP Path: utzoo!watmath!atbowler From: atbowler@watmath.UUCP (Alan T. Bowler [SDG]) Newsgroups: net.lang.c Subject: Re: register variables Message-ID: <15780@watmath.UUCP> Date: Tue, 16-Jul-85 21:09:38 EDT Article-I.D.: watmath.15780 Posted: Tue Jul 16 21:09:38 1985 Date-Received: Wed, 17-Jul-85 08:19:51 EDT References: <472@crystal.UUCP> Reply-To: atbowler@watmath.UUCP (Alan T. Bowler [SDG]) Distribution: net Organization: U of Waterloo, Ontario Lines: 12 Summary: The semantic meaning of a "register" declaration is NOT that the compiler must place the variable in a register. Instead if you stop to think it is really a declaration that this variable is never affected as a side effect of an indirect store (* or []), an so a copy of the variable in a register can still be believed. The "register" declaration should really only be interpreted in this sense, even though some compilers decide to always keep the first few such variables in registers. Compilers that do such are not in violation of this interpretation, but are taking an unneccessarily narrow interpretation, and as a result some times produce worse code since they lose the use of extra registers when they would be most useful. "register" is supposed to be an optimizing HINT, not suboptimal code requirement.