[net.arch] RISC perspective -- register variables

usenet@abnjh.UUCP (usenet) (03/14/84)

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

grahamr@azure.UUCP (Graham Ross) (03/30/84)

Rick Thomas is right about no aliases for a register variable.

I consider this a much more important result than the "fast"
idea.  The elimination of aliases is the only way to achieve
code hoisting, one of the nicest optimizations there is.  I
think the V6-V7 improvement of allowing more than 3 register
variables (how many of us remember that one?) was one of the
more insightful changes to C.  It showed a much keener awareness
of language concepts and a small but welcome departure from
implementation details.