This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/12826] Optimizer removes reference through volatile pointer


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]