aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/SparcV9/SparcV9InstrSelection.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
index c73264c221..fde7282e85 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp
+++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
@@ -1688,7 +1688,7 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
// to follow SSA def-use edges here, not BURG tree edges.
//
Instruction* result = subtreeRoot->getInstruction();
- Value* firstUse = (Value*) * result->use_begin();
+ Value* firstUse = result->use_empty() ? 0 : *result->use_begin();
bool discardResult =
(result->use_size() == 1
&& firstUse->isInstruction()