Robert Dewar wrote:
Richard Earnshaw wrote:
Possibly, but I think the more interesting observation is listed in
parenthesis: Can a volatile access ever alias a non-volatile access?
I think the answer is no, Certainly Ada has compile time rules
carefully written to make this impossible.
Usually I try to avoid the realm of "hypotetical targets" and
hypotetical optimizations, but I can imagine a target where one bit of a
register needs to be accessed in a volatile way and the others need not.
Then, I don't know if it would be legal to optimize
struct r {
unsigned int x : 7;
volatile unsigned int y : 1;
};
struct r my_reg;
So that my_reg.x is accessed with a non-volatile mem, and my_reg.y is
accessed with a volatile one. Would such an optimization be possible
within the Ada compile-time rules?
Paolo