Fix PR3522. It's not safe to sink into landing pad BB's.

llvm-svn: 64582
This commit is contained in:
Evan Cheng
2009-02-15 08:36:12 +00:00
parent 37959570af
commit 2510436e20
2 changed files with 35 additions and 0 deletions

View File

@@ -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);