http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53436

--- Comment #6 from o.mangold at googlemail dot com 2012-05-22 08:32:03 UTC ---
Yes, I get, that it's not a good way to do things, as (among other reasons) a
volatile access is no memory fence. So accesses to other locations may not be
ordered. But just for the sake of correctness, accesses should be ordered, if
they all go to volatile variables, no? From the C99-standard, section 5.1.2.3:

> At sequence points, volatile objects are stable in the sense that previous 
> accesses are complete and subsequent accesses have not yet occurred.

This means buffering the reads to the volatile variable over multiple
iterations of the while loop is not allowed, or do I get this wrong?

Reply via email to