summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Instructions.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2014-09-02 20:03:00 +0000
committerSanjay Patel <spatel@rotateright.com>2014-09-02 20:03:00 +0000
commitb2325b9ab36584c43b762295aa36db0a62413c93 (patch)
treebcc7b1864a315e09569727011cbeb1ee3acec70f /llvm/lib/IR/Instructions.cpp
parent0e893f53dd302f2af3550c058c2baef715204a30 (diff)
downloadbcm5719-llvm-b2325b9ab36584c43b762295aa36db0a62413c93.tar.gz
bcm5719-llvm-b2325b9ab36584c43b762295aa36db0a62413c93.zip
Fix a logic bug when copying fast-math flags.
"Setting" does not equal "copying". This bug has sat dormant for 2 reasons: 1. The unit test was not adequate. 2. Every current user of the "copyFastMathFlags" API is operating on a new instruction. (ie, all existing fast-math flags are off). If you copy flags to an existing instruction that has some flags on already, you will not necessarily turn them off as expected. I uncovered this bug while trying to implement a fix for PR20802. llvm-svn: 216939
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r--llvm/lib/IR/Instructions.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 16993f1bba5..b113d51d416 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -2043,7 +2043,7 @@ void BinaryOperator::copyFlags(const Value *V) {
// Copy the fast-math flags.
if (auto *FP = dyn_cast<FPMathOperator>(V))
- setFastMathFlags(FP->getFastMathFlags());
+ copyFastMathFlags(FP->getFastMathFlags());
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud