This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/22278] gcc -O2 discards cast to volatile
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jul 2005 05:18:17 -0000
- Subject: [Bug c/22278] gcc -O2 discards cast to volatile
- References: <20050702164323.22278.olivier.baudron@m4x.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2005-07-03 05:18 -------
Subject: Re: gcc -O2 discards cast to volatile
"gcc2eran at tromer dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| ------- Additional Comments From gcc2eran at tromer dot org 2005-07-03 05:09 -------
| (In reply to comment #32)
| > | I meant that we were mostly concerned about what the standard says about the
| > | effect of casting (say) int* into volatile int*, but the other directly is
| > | simply undefined.
| >
| > That is what I do not understand. Could you point me to the relevant
| > passage of the C standard?
|
| (my quote above should read "the other *direction* is simply undefined")
"the other direction" was very ambiguous.
[...]
| > Really? What does quux() does to the object defined through foo then?
|
| It refers to it through an lvalue whose type is "volatile int", which *is*
| volatile-qualified.
yes, you're right.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22278