This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12826] Optimizer removes reference through volatile pointer
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Oct 2003 17:11:01 -0000
- Subject: [Bug c/12826] Optimizer removes reference through volatile pointer
- References: <20031029145012.12826.lee@bustech.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.