aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/FloatingPoint.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-15 00:46:41 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-15 00:46:41 +0000
commitb929bca0279869b2b9649463318a68988302c0ce (patch)
tree2073ee794899152d993a02044523a41570db8793 /lib/Target/X86/FloatingPoint.cpp
parent1fda3700bee8842d6d1b1f637a3186b2af8a50db (diff)
Fix problem in DEBUG code. I could be pointing past the end and
dereferencing it causes an assertion error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/FloatingPoint.cpp')
-rw-r--r--lib/Target/X86/FloatingPoint.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/Target/X86/FloatingPoint.cpp b/lib/Target/X86/FloatingPoint.cpp
index 28517c339c..5755682767 100644
--- a/lib/Target/X86/FloatingPoint.cpp
+++ b/lib/Target/X86/FloatingPoint.cpp
@@ -245,20 +245,20 @@ bool FPS::processBasicBlock(MachineFunction &MF, MachineBasicBlock &BB) {
}
// Print out all of the instructions expanded to if -debug
- DEBUG(if (&*I == PrevMI) {
- std::cerr<< "Just deleted pseudo instruction\n";
- } else {
- MachineBasicBlock::iterator Start = I;
- // Rewind to first instruction newly inserted.
- while (Start != BB.begin() &&
- --Start != MachineBasicBlock::iterator(PrevMI));
- ++Start;
- std::cerr << "Inserted instructions:\n\t";
- Start->print(std::cerr, MF.getTarget());
- while (++Start != I); ++Start;
- }
- dumpStack();
- );
+ DEBUG(
+ MachineBasicBlock::iterator PrevI(PrevMI);
+ if (I == PrevI) {
+ std::cerr<< "Just deleted pseudo instruction\n";
+ } else {
+ MachineBasicBlock::iterator Start = I;
+ // Rewind to first instruction newly inserted.
+ while (Start != BB.begin() && prior(Start) != PrevI) --Start;
+ std::cerr << "Inserted instructions:\n\t";
+ Start->print(std::cerr, MF.getTarget());
+ while (++Start != next(I));
+ }
+ dumpStack();
+ );
Changed = true;
}