https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63736
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Known to work| |4.9.2, 5.0 Known to fail| |4.8.2 --- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- I can reproduce it with 4.8.2 and can confirm it seems to be fixed in 4.9.0 (even when linking to the libatomic.so from 4.8.2) #0 0x00007ffff7dcc898 in libat_exchange_16_i1 (mptr=0x604028, newval=<optimized out>, smodel=<optimized out>) at ../../../libatomic/exch_n.c:54 #1 0x00000000004011b4 in std::atomic<TwoFieldStruct>::exchange (this=0x604028, __i=..., _m=std::memory_order_seq_cst) at /usr/include/c++/4.8.3/atomic:225 #2 0x0000000000401111 in PStruct::setMs (this=0x604028, ms=...) at /var/tmp/atomic_of_struct_test.cpp:18 #3 0x0000000000400fb1 in main () at /var/tmp/atomic_of_struct_test.cpp:39