summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprComplex.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-02-14 01:35:12 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-02-14 01:35:12 +0000
commit1fc307f60cc61c65138624c49a702ac572acad45 (patch)
treea76327c64ba1a3fdee3cdfdcf6f3d94cd660b1c5 /lib/CodeGen/CGExprComplex.cpp
parent6bb2eb1bb505df2971279dbe188f9db1fb013ddd (diff)
downloadclang-1fc307f60cc61c65138624c49a702ac572acad45.tar.gz
Revert "Revert r229082 for a bit, it caused PR22577."
This reverts commit r229123. It was a red herring, the bug was present without r229082. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprComplex.cpp')
-rw-r--r--lib/CodeGen/CGExprComplex.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp
index ceec85a9a8..1fea5a127c 100644
--- a/lib/CodeGen/CGExprComplex.cpp
+++ b/lib/CodeGen/CGExprComplex.cpp
@@ -336,7 +336,8 @@ ComplexPairTy ComplexExprEmitter::EmitLoadOfLValue(LValue lvalue,
/// specified value pointer.
void ComplexExprEmitter::EmitStoreOfComplex(ComplexPairTy Val, LValue lvalue,
bool isInit) {
- if (lvalue.getType()->isAtomicType())
+ if (lvalue.getType()->isAtomicType() ||
+ (!isInit && CGF.LValueIsSuitableForInlineAtomic(lvalue)))
return CGF.EmitAtomicStore(RValue::getComplex(Val), lvalue, isInit);
llvm::Value *Ptr = lvalue.getAddress();