From 6ec78274df2f8de1fe3c99a54e168c8d4ccf5cf5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 5 Jan 2008 01:39:17 +0000 Subject: fix a common crash. llvm-svn: 45614 --- llvm/lib/CodeGen/MachineSink.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/CodeGen/MachineSink.cpp') diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp index 0665e87f67a..dff60f6d395 100644 --- a/llvm/lib/CodeGen/MachineSink.cpp +++ b/llvm/lib/CodeGen/MachineSink.cpp @@ -180,6 +180,10 @@ bool MachineSinking::SinkInstruction(MachineInstr *MI) { } } + // If there are no outputs, it must have side-effects. + if (SuccToSinkTo == 0) + return false; + // FIXME: Check that the instr doesn't have side effects etc. DEBUG(cerr << "Sink instr " << *MI); -- cgit v1.2.3