This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/47409] volatile struct member bug
- From: "regehr at cs dot utah.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Jan 2011 16:44:04 +0000
- Subject: [Bug c/47409] volatile struct member bug
- Auto-submitted: auto-generated
- References: <bug-47409-4@http.gcc.gnu.org/bugzilla/>
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.