summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-07-10 22:42:31 +0000
committerDan Gohman <gohman@apple.com>2010-07-10 22:42:31 +0000
commita64a3235649f3511e6b93bb20939ec7feeced4c4 (patch)
treee855302e46bf6641c612d12b530cbec5f5396985
parent79be2b9be5de9d00920da5b93941eccd5df9c2a4 (diff)
downloadbcm5719-llvm-a64a3235649f3511e6b93bb20939ec7feeced4c4.tar.gz
bcm5719-llvm-a64a3235649f3511e6b93bb20939ec7feeced4c4.zip
Fix a bug in the code which re-inserts DBG_VALUE nodes after scheduling;
if a block is split (by a custom inserter), the insert point may be in a different block than it was originally. This fixes 32-bit llvm-gcc bootstrap builds, and I haven't been able to reproduce it otherwise. llvm-svn: 108060
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
index 2673eba3f3e..06cf0530875 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
@@ -642,8 +642,10 @@ MachineBasicBlock *ScheduleDAGSDNodes::EmitSchedule() {
// Insert to start of the BB (after PHIs).
BB->insert(BBBegin, DbgMI);
else {
+ // Insert at the instruction, which may be in a different
+ // block, if the block was split by a custom inserter.
MachineBasicBlock::iterator Pos = MI;
- BB->insert(llvm::next(Pos), DbgMI);
+ MI->getParent()->insert(llvm::next(Pos), DbgMI);
}
}
}
OpenPOWER on IntegriCloud