aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/FunctionAttrs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO/FunctionAttrs.cpp')
-rw-r--r--lib/Transforms/IPO/FunctionAttrs.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp
index 65faef32e5..e8315247b2 100644
--- a/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -152,6 +152,11 @@ bool FunctionAttrs::AddReadAttrs(const std::vector<CallGraphNode *> &SCC) {
if (I->mayWriteToMemory())
// Writes memory. Just give up.
return false;
+
+ if (isa<MallocInst>(I))
+ // MallocInst claims not to write memory! PR3754.
+ return false;
+
// If this instruction may read memory, remember that.
ReadsMemory |= I->mayReadFromMemory();
}