diff options
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 3 | ||||
-rw-r--r-- | lib/Target/CBackend/Writer.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 9e10d5bc78..61072d1340 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -1033,7 +1033,8 @@ void CWriter::visitBinaryOperator(Instruction &I) { // We must cast the results of binary operations which might be promoted. bool needsCast = false; if ((I.getType() == Type::UByteTy) || (I.getType() == Type::SByteTy) - || (I.getType() == Type::UShortTy) || (I.getType() == Type::ShortTy)) { + || (I.getType() == Type::UShortTy) || (I.getType() == Type::ShortTy) + || (I.getType() == Type::FloatTy)) { needsCast = true; Out << "(("; printType(Out, I.getType(), "", false, false); diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 9e10d5bc78..61072d1340 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -1033,7 +1033,8 @@ void CWriter::visitBinaryOperator(Instruction &I) { // We must cast the results of binary operations which might be promoted. bool needsCast = false; if ((I.getType() == Type::UByteTy) || (I.getType() == Type::SByteTy) - || (I.getType() == Type::UShortTy) || (I.getType() == Type::ShortTy)) { + || (I.getType() == Type::UShortTy) || (I.getType() == Type::ShortTy) + || (I.getType() == Type::FloatTy)) { needsCast = true; Out << "(("; printType(Out, I.getType(), "", false, false); |