mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216939 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
Reference in New Issue
Block a user