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: 2 Jul 2005 22:39:44 -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-02 22:39 -------
Subject: Re: gcc -O2 discards cast to volatile
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| (In reply to comment #13)
| >
| > It is also wrong-code.
|
| This is the opposite view of what JSM said on IRC.
Sorry, I do not follow IRC, and it would be unfortunate that PRs get
closed based on claims we do not have logs for so that users and
people can look at them and scrutinize.
Furthermore, the fundamental issue is whether this
*(volatile int*) (int*) (&foo);
(or equivalent) where foo has been defined volatile int should be
treated differently from
*(volatile int*) (&foo);
or
foo;
For all useful purposes, it helps remembering that GCC is not an
academic exercise in C standard reading.
| Take it up with him if you believe otherwise.
| Basically this is all implemention defined and since we did not
| document before, we have a chance to define it to what we want.
and it is hard to believe we (GCC developers aiming at useful compiler,
as opposed to students doing academic exercise) will define it to be
either contradictory or the most useless as possible.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22278