[Bug c/47409] volatile struct member bug

regehr at cs dot utah.edu gcc-bugzilla@gcc.gnu.org
Mon Jan 24 16:53:00 GMT 2011


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

--- Comment #3 from John Regehr <regehr at cs dot utah.edu> 2011-01-24 16:43:58 UTC ---
(In reply to comment #2)
> Not sure if this is a bug at all, structure assignment should be implementable
> using memcpy or memmove and thus the side effects that will happen on it are
> not very well defined.

Hi Jakub-  "volatile" isn't a very strong guarantee, but realistically people
assume that if a volatile is on the RHS of an assignment, a load from that
location occurs (and a store, if on the LHS).  My guess is that violating this
contract will confuse embedded systems developers and break previously working
code.

Also, if the rule for volatile becomes significantly different from what I said
above, we won't be able to do volatile testing anymore since violations will be
sort of meaningless.



More information about the Gcc-bugs mailing list