[PATCH] avoid scheduling volatiles across sequence points

Eric Christopher echristo@redhat.com
Fri May 31 11:12:00 GMT 2002


> 
> No, it's OK.  The compiler is allowed to rearrange other memory
> accesses so long as it keeps volatile accesses and file operations in
> program order.  'program order' is determined by sequence points.
> 

I guess I was misreading this then?

http://gcc.gnu.org/onlinedocs/gcc/Volatiles.html

"The minimum either standard specifies is that at a sequence point all
previous accesses to volatile objects have stabilized and no subsequent
accesses have occurred. Thus an implementation is free to reorder and
combine volatile accesses which occur between sequence points, but
cannot do so for accesses across a sequence point."

This sounded like if a volatile was accessed both before and after a
sequence point that the sequence point had to stay there for it to be
valid.

I guess I was mistaken then.

Thanks.

-eric

-- 
I will not carve gods



More information about the Gcc-patches mailing list