volatile registers (was: The world is not ready for 'volatile')

Wendy Thrash wendyt at pyrps5
Wed Jan 11 10:45:38 AEST 1989


In article <298 at twwells.uucp> bill at twwells.UUCP (T. William Wells) writes:
>To alias something, one must have its
>address.  Registers can't have their addresses taken. Therefore
>register variables can't be aliased. QED.

If the above is a statement about register variables in standard-conforming C
programs, it may be true; if it's a statement about computer hardware, it
is false.  On Pyramid hardware, for example,  one is quite free to take the
addresses of registers (though it takes a couple of instructions to do so).
Our current implementation of C also allows taking the address of a register
variable, remarking as it does that,
"warning: taking the address of a register variable is not portable".

We now have a proof and a counterexample.



More information about the Comp.std.c mailing list