diff --git a/lib/msun/src/s_lround.c b/lib/msun/src/s_lround.c index 66d9183a74b..c4d305401ac 100644 --- a/lib/msun/src/s_lround.c +++ b/lib/msun/src/s_lround.c @@ -49,9 +49,11 @@ __FBSDID("$FreeBSD$"); * that everything is in range. At compile time, INRANGE(x) should reduce to * two floating-point comparisons in the former case, or TRUE otherwise. */ -static const type dtype_min = (type)DTYPE_MIN - 0.5; -static const type dtype_max = (type)DTYPE_MAX + 0.5; -#define INRANGE(x) (dtype_max - (type)DTYPE_MAX != 0.5 || \ +static const type type_min = (type)DTYPE_MIN; +static const type type_max = (type)DTYPE_MAX; +static const type dtype_min = type_min - 0.5; +static const type dtype_max = type_max + 0.5; +#define INRANGE(x) (dtype_max - type_max != 0.5 || \ ((x) > dtype_min && (x) < dtype_max)) dtype diff --git a/lib/msun/tests/lround_test.c b/lib/msun/tests/lround_test.c index a6daa5459c7..ddb2b2cea9b 100644 --- a/lib/msun/tests/lround_test.c +++ b/lib/msun/tests/lround_test.c @@ -40,14 +40,9 @@ __FBSDID("$FreeBSD$"); #define IGNORE 0x12345 -/* - * XXX The volatile here is to avoid gcc's bogus constant folding and work - * around the lack of support for the FENV_ACCESS pragma. - */ #define test(func, x, result, excepts) do { \ - volatile double _d = x; \ ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - volatile double _r = (func)(_d); \ + long long _r = (func)(x); \ CHECK_FP_EXCEPTIONS_MSG(excepts, FE_ALL_EXCEPT, "for %s(%s)", \ #func, #x); \ if ((excepts & FE_INVALID) != 0) { \