[PATCH] CodeGen: Don't completely mess-up optimized atomic libcalls

David Majnemer david.majnemer at gmail.com
Tue Nov 25 12:11:38 PST 2014


REPOSITORY
  rL LLVM

================
Comment at: cfe/trunk/lib/CodeGen/CGAtomic.cpp:747
@@ +746,3 @@
+    if (!RetTy->isVoidType()) {
+      if (UseOptimizedLibcall) {
+        if (HaveRetTy)
----------------
robertlytton wrote:
> Hi David,
> 
> I've been chasing issues with libcxx for the xcore - hence finding this late in the day.
> 
> For non-optimized lib calls that return a value, don't we want to return the 'Res'?
> viz:
> if (!RetTy->isVoidType()) {
>   if (HaveRetTy)
>     return Res;
>   if (UseOptimizedLibcall) {
>     ...
> 
> Have I understood the code correctly?
> 
> Robert
This bug manifests itself in exactly one case as far as I can tell: `__atomic_compare_exchange`.  I'm working on a small cleanup to this code because it's not in great shape.  It'll be fixed by tonight.

http://reviews.llvm.org/D5098






More information about the cfe-commits mailing list