https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70091
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Status|UNCONFIRMED |NEW Last reconfirmed| |2016-03-07 Ever confirmed|0 |1 Known to fail| |5.3.0 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- The C++ FE emits ;; Function void bitfield::and_assign() volatile (null) ;; enabled by -tree-original <<cleanup_point <<< Unknown tree: expr_stmt (void) (((volatile struct bitfield *) this)->_raw = *(volatile struct bitfield *) this;, bitfield::_and ((unsigned int) ((volatile struct bitfield *) this)->_raw, 1);) >>>>>; <<cleanup_point <<< Unknown tree: expr_stmt (void) (((volatile struct bitfield *) this)->_raw = (unsigned int) ((volatile struct bitfield *) this)->_raw & 1) >>>>>; there's the odd ((volatile struct bitfield *) this)->_raw = *(volatile struct bitfield *) this; statement which causes this. But the store goes away somehow. GIMPLE: void bitfield::and_assign() volatile (volatile struct bitfield * const this) { struct bitfield vol.0; unsigned int D.2339; unsigned int D.2340; unsigned int D.2341; unsigned int D.2342; vol.0 = *this; D.2339 = this->_raw; D.2340 = bitfield::_and (D.2339, 1); this->_raw = D.2340; Confirmed as FE bug.