[PATCH] D14385: Correct atomic libcall support for __atomic_*_fetch builtins.

James Y Knight via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 09:24:34 PST 2015


jyknight created this revision.
jyknight added a reviewer: rsmith.
jyknight added subscribers: majnemer, compnerd, cfe-commits, tstellarAMD.

In r244063, I had caused these builtins to call the same-named library
functions, __atomic_*_fetch_SIZE. However, this was incorrect: while
those functions are in fact supported by GCC's libatomic, they're not
documented by the spec (and gcc doesn't ever call them).

Instead, you're /supposed/ to call the __atomic_fetch_* builtins and
then redo the operation inline to return the final value.

http://reviews.llvm.org/D14385

Files:
  lib/CodeGen/CGAtomic.cpp
  test/CodeGen/atomic-ops-libcall.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14385.39375.patch
Type: text/x-patch
Size: 9159 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151105/76386ad3/attachment.bin>


More information about the cfe-commits mailing list