aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/Analysis.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-08-11 15:29:02 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-08-11 15:29:02 +0000
commit2e7af979b91203aa09daed54aee9083cd5e228b9 (patch)
tree9b3538ea10b2aabf6383e0c95c211d910b49adae /llvm/lib/CodeGen/Analysis.cpp
parent3f69195b9e43b76a35ae8c8d86cf51ea942a6b0e (diff)
downloadllvm-2e7af979b91203aa09daed54aee9083cd5e228b9.zip
llvm-2e7af979b91203aa09daed54aee9083cd5e228b9.tar.gz
llvm-2e7af979b91203aa09daed54aee9083cd5e228b9.tar.bz2
CodeGen: Check for a terminator in llvm::getFuncletMembership
Check for an end iterator from MachineBasicBlock::getFirstTerminator in llvm::getFuncletMembership. If this is turned into an assertion, it fires in 48 X86 testcases (for example, CodeGen/X86/regalloc-spill-at-ehpad.ll). Since this is likely a latent bug (shouldn't all basic blocks end with a terminator?) I've filed PR28938. llvm-svn: 278344
Diffstat (limited to 'llvm/lib/CodeGen/Analysis.cpp')
-rw-r--r--llvm/lib/CodeGen/Analysis.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/Analysis.cpp b/llvm/lib/CodeGen/Analysis.cpp
index d690734..9fb29b8 100644
--- a/llvm/lib/CodeGen/Analysis.cpp
+++ b/llvm/lib/CodeGen/Analysis.cpp
@@ -694,6 +694,11 @@ llvm::getFuncletMembership(const MachineFunction &MF) {
}
MachineBasicBlock::const_iterator MBBI = MBB.getFirstTerminator();
+
+ // FIXME: Should this be an assertion? It fires all over in X86.
+ if (MBBI == MBB.end())
+ continue;
+
// CatchPads are not funclets for SEH so do not consider CatchRet to
// transfer control to another funclet.
if (MBBI->getOpcode() != TII->getCatchReturnOpcode())