1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Patch to support MSVC, contributed by Morten Ofstad

llvm-svn: 17214
This commit is contained in:
Chris Lattner 2004-10-25 18:40:08 +00:00
parent 3286872a18
commit 1cef20bac1

View File

@ -1984,7 +1984,7 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec) {
cast<ConstantUInt>(ConstantExpr::getCast(SqrtTerm,
SqrtTerm->getType()->getUnsignedVersion()));
uint64_t SqrtValV = SqrtVal->getValue();
uint64_t SqrtValV2 = (uint64_t)sqrt(SqrtValV);
uint64_t SqrtValV2 = (uint64_t)sqrt((double)SqrtValV);
// The square root might not be precise for arbitrary 64-bit integer
// values. Do some sanity checks to ensure it's correct.
if (SqrtValV2*SqrtValV2 > SqrtValV ||