Don't leave the FPOptions in a UnaryOperator uninitialized.
We don't appear to use these FPOptions for anything right now, but they shouldn't be uninitialized because that makes our AST file output nondeterministic.
This commit is contained in:
parent
de71b46a51
commit
9860e68450
|
@ -4569,6 +4569,8 @@ UnaryOperator::UnaryOperator(const ASTContext &Ctx, Expr *input, Opcode opc,
|
|||
UnaryOperatorBits.CanOverflow = CanOverflow;
|
||||
UnaryOperatorBits.Loc = l;
|
||||
UnaryOperatorBits.HasFPFeatures = FPFeatures.requiresTrailingStorage();
|
||||
if (hasStoredFPFeatures())
|
||||
setStoredFPFeatures(FPFeatures);
|
||||
setDependence(computeDependence(this));
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// RUN: rm -rf %t
|
||||
// RUN: mkdir %t
|
||||
|
||||
// RUN: %clang_cc1 -x c++-header %s -emit-pch -o %t/a.pch
|
||||
// RUN: %clang_cc1 -x c++-header %s -emit-pch -o %t/b.pch
|
||||
// RUN: cmp %t/a.pch %t/b.pch
|
||||
|
||||
#pragma float_control(push)
|
||||
double fp_control_1(double x) {
|
||||
#pragma float_control(precise, on)
|
||||
return -x + x;
|
||||
}
|
||||
|
||||
double fp_control_2(double x) {
|
||||
#pragma float_control(precise, off)
|
||||
return -x + x;
|
||||
}
|
||||
#pragma float_control(pop)
|
Loading…
Reference in New Issue