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 bangerth at dealii dot org  2003-10-29 17:10 -------
> But it does change the object's volatility to change the assignment of "*sp =
> 0xE8" to "* (volatile char *) sp = 0xE8".

No, it doesn't. The type of a variable is a static quantity and not changed by
how you assign a value to it. You declared sp to be non-volatile, so it will
always be non-volatile.

> Gcc should at least be consistent
> here, it seems...

gcc is missing a chance to optimize. That's not a bug.

> I'm not sure what you mean here, the char is what I want to be volatile,

Then _declare_ it to be volatile!

W.


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