This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] avoid scheduling volatiles across sequence points



> 
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]