]> granicus.if.org Git - clang/commitdiff
Always initialize FPContractable.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 3 Oct 2012 20:58:04 +0000 (20:58 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 3 Oct 2012 20:58:04 +0000 (20:58 +0000)
false is used as a baseline here, we may want to allow contraction in some of
the cases.  Found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165156 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprScalar.cpp

index 6d25642d02bebd89389135e6e995fefdde0fd6e3..0d68ff5a69c5a266199b988a9de624e2f411ed35 100644 (file)
@@ -1261,6 +1261,7 @@ EmitAddConsiderOverflowBehavior(const UnaryOperator *E,
     BinOp.RHS = NextVal;
     BinOp.Ty = E->getType();
     BinOp.Opcode = BO_Add;
+    BinOp.FPContractable = false;
     BinOp.E = E;
     return EmitOverflowCheckedBinOp(BinOp);
   }
@@ -1446,6 +1447,7 @@ Value *ScalarExprEmitter::VisitUnaryMinus(const UnaryOperator *E) {
     BinOp.LHS = llvm::Constant::getNullValue(BinOp.RHS->getType());
   BinOp.Ty = E->getType();
   BinOp.Opcode = BO_Sub;
+  BinOp.FPContractable = false;
   BinOp.E = E;
   return EmitSub(BinOp);
 }
@@ -1681,6 +1683,7 @@ LValue ScalarExprEmitter::EmitCompoundAssignLValue(
   OpInfo.RHS = Visit(E->getRHS());
   OpInfo.Ty = E->getComputationResultType();
   OpInfo.Opcode = E->getOpcode();
+  OpInfo.FPContractable = false;
   OpInfo.E = E;
   // Load/convert the LHS.
   LValue LHSLV = EmitCheckedLValue(E->getLHS(), CodeGenFunction::TCK_Store);