diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index e0daca5a66d..8b108c23354 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -701,6 +701,11 @@ ConstantInt *ConstantInt::get(const Type *Ty, unsigned char V) { static ValueMap FPConstants; ConstantFP *ConstantFP::get(const Type *Ty, double V) { + if (Ty == Type::FloatTy) { + // Force the value through memory to normalize it. + volatile float Tmp = V; + V = Tmp; + } return FPConstants.getOrCreate(Ty, V); }