https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95750
--- Comment #10 from Uroš Bizjak <ubizjak at gmail dot com> --- Created attachment 48756 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48756&action=edit Proposed patch Patch in testing, survives GOMP testcases. On a related note, the patch uses TARGET_USE_XCHG_FOR_ATOMIC_STORE, which should probably be renamed to something more appropriate.