RISC perspective -- register variables

usenet usenet at abnjh.UUCP
Thu Mar 15 01:27:29 AEST 1984


The keyword 'register' does not mean just 'fast' !!!
It also means that there will never be a pointer to that variable.
(Technically, there can be no 'aliasing' problems for register
variables.)  Thus, it is meaningful and potentially useful for you
to declare all the variables in a program to be register
storage class.  The compiler can apply certain optimizations if it
knows there are no aliases for a particular variable.  Those
optimizations are not 'safe' to apply in the general case.

PCC, at least, enforces this restriction; you cannot apply the '&'
operator to a register variable.

Rick Thomas
ihnp4!abnji!rbt   or   ihnp4!abnjh!usenet



More information about the Comp.lang.c mailing list