From 2510436e20b761010cd2507cf3822cd36d4d799f Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sun, 15 Feb 2009 08:36:12 +0000 Subject: Fix PR3522. It's not safe to sink into landing pad BB's. llvm-svn: 64582 --- llvm/lib/CodeGen/MachineSink.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/CodeGen/MachineSink.cpp') diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp index a85a41fbaee..468bd01548c 100644 --- a/llvm/lib/CodeGen/MachineSink.cpp +++ b/llvm/lib/CodeGen/MachineSink.cpp @@ -212,6 +212,11 @@ bool MachineSinking::SinkInstruction(MachineInstr *MI, bool &SawStore) { // If there are no outputs, it must have side-effects. if (SuccToSinkTo == 0) return false; + + // It's not safe to sink instructions to EH landing pad. Control flow into + // landing pad is implicitly defined. + if (SuccToSinkTo->isLandingPad()) + return false; DEBUG(cerr << "Sink instr " << *MI); DEBUG(cerr << "to block " << *SuccToSinkTo); -- cgit v1.2.3