Mark the load after calling objc_msg_lookup_sender() so that it doesn't get optimised away (GNU runtime).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109010 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index faec7ee..41c1a2a 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -722,8 +722,8 @@
// The lookup function may have changed the receiver, so make sure we use
// the new one.
- ActualArgs[0] =
- std::make_pair(RValue::get(Builder.CreateLoad(ReceiverPtr)), ASTIdTy);
+ ActualArgs[0] = std::make_pair(RValue::get(
+ Builder.CreateLoad(ReceiverPtr, true)), ASTIdTy);
} else {
std::vector<const llvm::Type*> Params;
Params.push_back(Receiver->getType());