[Bug c/12826] Optimizer removes reference through volatile pointer
lee at bustech dot com
gcc-bugzilla@gcc.gnu.org
Wed Oct 29 16:43:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12826
------- Additional Comments From lee at bustech dot com 2003-10-29 16:39 -------
> ... you are accessing a non-volatile object
> through a pointer to a volatile char. That doesn't change the
> non-volatility of the object
But it does change the object's volatility to change the assignment of "*sp =
0xE8" to "* (volatile char *) sp = 0xE8". Gcc should at least be consistent
here, it seems...
> As I said, it's the volatility of the *object* that is relevant.
I'm not sure what you mean here, the char is what I want to be volatile, and the
cast seems to express that for me.
Thanks,
Lee
More information about the Gcc-bugs
mailing list