diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index b93f1d109a0..df309d49c66 100644 --- a/lib/Support/APFloat.cpp +++ b/lib/Support/APFloat.cpp @@ -1784,7 +1784,8 @@ APFloat::convertToSignExtendedInteger(integerPart *parts, unsigned int width, if(category == fcZero) { APInt::tcSet(parts, 0, dstPartsCount); - return opOK; + // Negative zero can't be represented as an int. + return sign ? opInexact : opOK; } src = significandParts();