https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58945
Uroš Bizjak <ubizjak at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #33729|0 |1 is obsolete| | Attachment #33744|0 |1 is obsolete| | Assignee|steven at gcc dot gnu.org |ubizjak at gmail dot com --- Comment #8 from Uroš Bizjak <ubizjak at gmail dot com> --- Created attachment 35190 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35190&action=edit Patch to simplify atomic_compare_and_swap<dwi>_doubleword pattern At the end of the day ... the problem was in the patch itself, the infrastructure is OK. We have to use "A" constraint for doubleword eax/edx register pair. Where did I put my brown paperbag? The resulting code for the testcase from the Comment #0 is considerably better: movq i(%rip), %rax movq $-1, %rcx movq i+8(%rip), %rdx .L2: movq %rcx, %rbx lock; cmpxchg16b i(%rip) jne .L2