Available No. of Registers

jjw at celerity.UUCP jjw at celerity.UUCP
Tue Jan 27 02:41:37 AEST 1987


In article <2250 at jade.BERKELEY.EDU> mwm at eris.BERKELEY.EDU (Mike Meyer) writes:
>
>There is a false implication in the above: that it doesn't hurt to add
>register declerations. There is at least one compiler out there that
>effectively allocates registers from the last declared instead of the
>first, so that blindly adding registers to code can slow the generatred
>code down.

My version of K&R states (page 193, section 8.1 "Storage Class Specifiers)":
	A register declaration is best thought of as an auto declaration,
	together with a hint to the compiler that the variables will be
	heavily used.  Only the first few such declarations are effective.
	                        ^^^^^

This implies to me that a conforming compiler should allocate "registers"
starting with the first declaration.



More information about the Comp.lang.c mailing list