aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 8522b610e1..db178b3d1f 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -1801,7 +1801,8 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
const Type *OldRetTy = Caller->getType();
if (Callee->isExternal() &&
- !OldRetTy->isLosslesslyConvertibleTo(FT->getReturnType()))
+ !OldRetTy->isLosslesslyConvertibleTo(FT->getReturnType()) &&
+ !Caller->use_empty())
return false; // Cannot transform this return value...
unsigned NumActualArgs = unsigned(CS.arg_end()-CS.arg_begin());