diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-14 06:33:45 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-14 06:33:45 +0000 |
commit | 04223909b74fd0634ba26d434fa7fdf2f3c7444f (patch) | |
tree | fc27b80cff959412dfb50792890b1337ff450b29 /lib/CodeGen/PHIElimination.cpp | |
parent | d357e88740686e41e9f7fa208887336eb9af3c47 (diff) | |
download | external_llvm-04223909b74fd0634ba26d434fa7fdf2f3c7444f.zip external_llvm-04223909b74fd0634ba26d434fa7fdf2f3c7444f.tar.gz external_llvm-04223909b74fd0634ba26d434fa7fdf2f3c7444f.tar.bz2 |
Try for the third time to teach getFirstTerminator() about debug values.
This time let's rephrase to trick gcc-4.3 into not miscompiling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PHIElimination.cpp')
-rw-r--r-- | lib/CodeGen/PHIElimination.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp index 923fa21..b940e26 100644 --- a/lib/CodeGen/PHIElimination.cpp +++ b/lib/CodeGen/PHIElimination.cpp @@ -339,6 +339,8 @@ void PHIElimination::LowerAtomicPHINode( #ifndef NDEBUG for (MachineBasicBlock::iterator TI = llvm::next(Term); TI != opBlock.end(); ++TI) { + if (TI->isDebugValue()) + continue; assert(!TI->readsRegister(SrcReg) && "Terminator instructions cannot use virtual registers unless" "they are the first terminator in a block!"); @@ -347,9 +349,13 @@ void PHIElimination::LowerAtomicPHINode( } else if (reusedIncoming || !IncomingReg) { // We may have to rewind a bit if we didn't insert a copy this time. KillInst = Term; - while (KillInst != opBlock.begin()) - if ((--KillInst)->readsRegister(SrcReg)) + while (KillInst != opBlock.begin()) { + --KillInst; + if (KillInst->isDebugValue()) + continue; + if (KillInst->readsRegister(SrcReg)) break; + } } else { // We just inserted this copy. KillInst = prior(InsertPos); |