This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: volatile semantics
Daniel Berlin <dberlin@dberlin.org> writes:
| Anything it sees anything in a statement with volatile, it marks the
| statement as volatile, which should stop things from touching it
| (anything that *does* optimize something marked volatile is buggy).
great!
| I should note that this will probably annoy the people who reported :
|
| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3506
The rationale is:
GCC doesn't know what constitutes a reference to a volatile memory,
so it never performs operations on them directly. It will always
pull the value into a register first.
| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18617
If the statement that anything that does optimze something marked
volatile is buggy, how can that PR be considered a bug in GCC?
| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21580
GCC generates:
(1) read the volatile variable into location rho;
(2) compute rho <- rho + 1
(3) store rho back in the variable
As far as I can see, this matches the previous statement that anything
that is marrked volatile is not optimized.
| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20222
Andrew Pinski has declared this to be a bug, but the audit trail
isn't clear as to why.
| (there's a couple others).
|
| Then again, I'm pretty willing at this point to laugh at people who use
| volatile and complain about code quality
then you'll be in good company ;-/
-- Gaby