Article View: comp.std.c
Article #5573Re: volatile registers (was: The world is not ready for 'volatile')
From: T. William Wells
Date: Wed, 11 Jan 1989 14:38
Date: Wed, 11 Jan 1989 14:38
27 lines
1757 bytes
1757 bytes
In article <54573@pyramid.pyramid.com> wendyt@pyrps5.UUCP (Wendy Thrash) writes:
: In article <298@twwells.uucp> bill@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.
It's about register variables in a standard-conforming program.
I know of one machine where registers are indistinguishable from a
certain area of memory. One could even store instructions in the
registers and branch there! And on several micro compilers, register
is interpreted to mean "put this into fast memory" (they don't have
any registers useful for storing C variables).
---
Bill
{ uunet!proxftl | novavax } !twwells!bill
Technical Details
Message-ID:
<320@twwells.uucp>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!pacbell!ames!mailrus!uflorida!novavax!twwells!billReferences:
<54573@pyramid.pyramid.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!pacbell!ames!mailrus!uflorida!novavax!twwells!bill From: bill@twwells.uucp (T. William Wells) Newsgroups: comp.std.c Subject: Re: volatile registers (was: The world is not ready for 'volatile') Message-ID: <320@twwells.uucp> Date: 11 Jan 89 14:38:33 GMT References: <54573@pyramid.pyramid.com> Reply-To: bill@twwells.UUCP (T. William Wells) Organization: None, Ft. Lauderdale Lines: 27