http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50364
Bug #: 50364 Summary: Volatile miscompilation Classification: Unclassified Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: abramobagn...@tin.it $ cat p.cc volatile int a, b; void f() { b = 1 + (a = 0); } $ g++ -O2 -S p.cc $ cat p.s .file "p.cc" .text .p2align 4,,15 .globl _Z1fv .type _Z1fv, @function _Z1fv: .LFB0: .cfi_startproc movl $0, a movl $1, b ret .cfi_endproc ... As the typescript above shows, the conversion between lvalue (a = 0) and relative rvalue does not generate a volatile read memory access unlike what I think that standard mandates.