Make tiny volatile to prevent the compiler(s) from

constant folding expressions of the form "1 - tiny",
which are used to raise FE_INEXACT.
This commit is contained in:
Steve Kargl 2014-08-30 17:14:47 +00:00
parent ec4a0b4408
commit 79c2e69a3f
2 changed files with 5 additions and 2 deletions

View File

@ -42,7 +42,8 @@ __FBSDID("$FreeBSD$");
#include "math.h"
#include "math_private.h"
static const double one = 1.0, two = 2.0, tiny = 1.0e-300, huge = 1.0e300;
static volatile const double tiny = 1.0e-300;
static const double one = 1.0, two = 2.0, huge = 1.0e300;
double
tanh(double x)

View File

@ -19,7 +19,9 @@ __FBSDID("$FreeBSD$");
#include "math.h"
#include "math_private.h"
static const float one=1.0, two=2.0, tiny = 1.0e-30, huge = 1.0e30;
static volatile const float tiny = 1.0e-30;
static const float one=1.0, two=2.0, huge = 1.0e30;
float
tanhf(float x)
{