From: Chris Lattner Date: Sat, 5 Jan 2008 01:39:17 +0000 (+0000) Subject: fix a common crash. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9bb459b55411c45175e599f6f421b7a57060ee57;p=oota-llvm.git fix a common crash. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45614 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/MachineSink.cpp b/lib/CodeGen/MachineSink.cpp index 0665e87f67a..dff60f6d395 100644 --- a/lib/CodeGen/MachineSink.cpp +++ b/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);