summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86FloatingPoint.cpp
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2015-06-30 14:38:57 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2015-06-30 14:38:57 +0000
commit8a6c9ccc9899d8eceff91780be8e7bb756ee63d7 (patch)
treef63af60cc8dcbfc3e8985d4f90513d8fb83d16c2 /llvm/lib/Target/X86/X86FloatingPoint.cpp
parent660dcd9168276f655ea365476ba23e82b8d10381 (diff)
downloadbcm5719-llvm-8a6c9ccc9899d8eceff91780be8e7bb756ee63d7.tar.gz
bcm5719-llvm-8a6c9ccc9899d8eceff91780be8e7bb756ee63d7.zip
[X86] Fix a bug in WIN_FTOL_32/64 handling.
Duplicating an FP register "as itself" is a bad idea, since it violates the invariant that every FP register is mapped to at most one FPU stack slot. Use the scratch FP register instead. This fixes PR23957. llvm-svn: 241069
Diffstat (limited to 'llvm/lib/Target/X86/X86FloatingPoint.cpp')
-rw-r--r--llvm/lib/Target/X86/X86FloatingPoint.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86FloatingPoint.cpp b/llvm/lib/Target/X86/X86FloatingPoint.cpp
index 3b0bd03095a..40b9c8a863a 100644
--- a/llvm/lib/Target/X86/X86FloatingPoint.cpp
+++ b/llvm/lib/Target/X86/X86FloatingPoint.cpp
@@ -1530,7 +1530,7 @@ void FPS::handleSpecialFP(MachineBasicBlock::iterator &Inst) {
if (Op.isKill())
moveToTop(FPReg, Inst);
else
- duplicateToTop(FPReg, FPReg, Inst);
+ duplicateToTop(FPReg, ScratchFPReg, Inst);
// Emit the call. This will pop the operand.
BuildMI(*MBB, Inst, MI->getDebugLoc(), TII->get(X86::CALLpcrel32))
OpenPOWER on IntegriCloud