aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/X86/FloatingPoint.cpp15
-rw-r--r--lib/Target/X86/X86FloatingPoint.cpp15
2 files changed, 16 insertions, 14 deletions
diff --git a/lib/Target/X86/FloatingPoint.cpp b/lib/Target/X86/FloatingPoint.cpp
index 70a643b254..e47554b57b 100644
--- a/lib/Target/X86/FloatingPoint.cpp
+++ b/lib/Target/X86/FloatingPoint.cpp
@@ -682,13 +682,14 @@ void FPS::handleCondMovFP(MachineBasicBlock::iterator &I) {
MI->getOperand(0).setReg(getSTReg(Op1));
// If we kill the second operand, make sure to pop it from the stack.
- for (LiveVariables::killed_iterator KI = LV->killed_begin(MI),
- E = LV->killed_end(MI); KI != E; ++KI)
- if (KI->second == X86::FP0+Op1) {
- // Get this value off of the register stack.
- freeStackSlotAfter(I, Op1);
- break;
- }
+ if (Op0 != Op1)
+ for (LiveVariables::killed_iterator KI = LV->killed_begin(MI),
+ E = LV->killed_end(MI); KI != E; ++KI)
+ if (KI->second == X86::FP0+Op1) {
+ // Get this value off of the register stack.
+ freeStackSlotAfter(I, Op1);
+ break;
+ }
}
diff --git a/lib/Target/X86/X86FloatingPoint.cpp b/lib/Target/X86/X86FloatingPoint.cpp
index 70a643b254..e47554b57b 100644
--- a/lib/Target/X86/X86FloatingPoint.cpp
+++ b/lib/Target/X86/X86FloatingPoint.cpp
@@ -682,13 +682,14 @@ void FPS::handleCondMovFP(MachineBasicBlock::iterator &I) {
MI->getOperand(0).setReg(getSTReg(Op1));
// If we kill the second operand, make sure to pop it from the stack.
- for (LiveVariables::killed_iterator KI = LV->killed_begin(MI),
- E = LV->killed_end(MI); KI != E; ++KI)
- if (KI->second == X86::FP0+Op1) {
- // Get this value off of the register stack.
- freeStackSlotAfter(I, Op1);
- break;
- }
+ if (Op0 != Op1)
+ for (LiveVariables::killed_iterator KI = LV->killed_begin(MI),
+ E = LV->killed_end(MI); KI != E; ++KI)
+ if (KI->second == X86::FP0+Op1) {
+ // Get this value off of the register stack.
+ freeStackSlotAfter(I, Op1);
+ break;
+ }
}