https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66713
Bug ID: 66713 Summary: atomic compare_excahnge_strong create spurious store for x86-64 at -O3 Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: tkoeppe at google dot com Target Milestone: --- The code here: https://goo.gl/CiV4pl compares a hand-written CAS with the C++11 atomic one. On Clang, the code comes out identical. On GCC 4.9.2 and later there is an extra store ("movq %rdi, -8(%rsp)"). Should that not be there?