[Bug c/12826] Optimizer removes reference through volatile pointer
lee at bustech dot com
gcc-bugzilla@gcc.gnu.org
Wed Oct 29 16:16: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:00 -------
Thanks for your reply, cdecl gives me:
cdecl> explain volatile char *sp
declare sp as pointer to volatile char
Which is what I want, a volatile char which should be read every time via sp. If
I declare sp as "volatile char *" the code reads *sp as expected. It just seems
that a cast should be equivalent to a declaration here...
Lee
P.S. Changing the assignment of "*sp = 0xE8" to "* (volatile char *) sp = 0xE8"
also fixes the problem, which seems kind of odd.
More information about the Gcc-bugs
mailing list