SHA256
3
0
forked from pool/glibc
glibc/nearbyint-inexact.patch
Andreas Schwab c0dd082d43 Accepting request 529148 from home:Andreas_Schwab:Factory
- assert-pedantic.patch: Suppress pedantic warning caused by statement
  expression (BZ #21242, BZ #21972)
- math-c++-compat.patch: Add more C++ compatibility
- getaddrinfo-errno.patch: Fix errno and h_errno handling in getaddrinfo
  (BZ #21915, BZ #21922)
- resolv-conf-oom.patch: Fix memory handling in OOM situation during
  resolv.conf parsing (BZ #22095, BZ #22096)
- dynarray-enlarge.patch: Fix initial size of dynarray allocation and set
  errno on overflow error
- nearbyint-inexact.patch: Avoid spurious inexact in nearbyint (BZ #22225)

OBS-URL: https://build.opensuse.org/request/show/529148
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=479
2017-09-28 14:37:11 +00:00

108 lines
3.5 KiB
Diff

2017-09-28 Joseph Myers <joseph@codesourcery.com>
[BZ #22225]
* sysdeps/ieee754/dbl-64/s_nearbyint.c (__nearbyint): Use
math_opt_barrier on argument when doing arithmetic on it.
* sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c (__nearbyint):
Likewise. Use math_force_eval not math_opt_barrier after
arithmetic.
* sysdeps/ieee754/flt-32/s_nearbyintf.c (__nearbyintf): Use
math_opt_barrier on argument when doing arithmetic on it.
* sysdeps/ieee754/ldbl-128/s_nearbyintl.c (__nearbyintl):
Likewise.
Index: glibc-2.26/sysdeps/ieee754/dbl-64/s_nearbyint.c
===================================================================
--- glibc-2.26.orig/sysdeps/ieee754/dbl-64/s_nearbyint.c
+++ glibc-2.26/sysdeps/ieee754/dbl-64/s_nearbyint.c
@@ -48,7 +48,7 @@ __nearbyint (double x)
if (j0 < 0)
{
libc_feholdexcept (&env);
- w = TWO52[sx] + x;
+ w = TWO52[sx] + math_opt_barrier (x);
t = w - TWO52[sx];
math_force_eval (t);
libc_fesetenv (&env);
@@ -65,7 +65,7 @@ __nearbyint (double x)
return x; /* x is integral */
}
libc_feholdexcept (&env);
- w = TWO52[sx] + x;
+ w = TWO52[sx] + math_opt_barrier (x);
t = w - TWO52[sx];
math_force_eval (t);
libc_fesetenv (&env);
Index: glibc-2.26/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
===================================================================
--- glibc-2.26.orig/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
+++ glibc-2.26/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
@@ -42,9 +42,9 @@ __nearbyint(double x)
if(__builtin_expect(j0<52, 1)) {
if(j0<0) {
libc_feholdexcept (&env);
- double w = TWO52[sx]+x;
+ double w = TWO52[sx] + math_opt_barrier (x);
double t = w-TWO52[sx];
- math_opt_barrier(t);
+ math_force_eval (t);
libc_fesetenv (&env);
return __copysign (t, x);
}
@@ -53,9 +53,9 @@ __nearbyint(double x)
else return x; /* x is integral */
}
libc_feholdexcept (&env);
- double w = TWO52[sx]+x;
+ double w = TWO52[sx] + math_opt_barrier (x);
double t = w-TWO52[sx];
- math_opt_barrier (t);
+ math_force_eval (t);
libc_fesetenv (&env);
return t;
}
Index: glibc-2.26/sysdeps/ieee754/flt-32/s_nearbyintf.c
===================================================================
--- glibc-2.26.orig/sysdeps/ieee754/flt-32/s_nearbyintf.c
+++ glibc-2.26/sysdeps/ieee754/flt-32/s_nearbyintf.c
@@ -37,7 +37,7 @@ __nearbyintf(float x)
if(j0<23) {
if(j0<0) {
libc_feholdexceptf (&env);
- w = TWO23[sx]+x;
+ w = TWO23[sx] + math_opt_barrier (x);
t = w-TWO23[sx];
math_force_eval (t);
libc_fesetenvf (&env);
@@ -50,7 +50,7 @@ __nearbyintf(float x)
else return x; /* x is integral */
}
libc_feholdexceptf (&env);
- w = TWO23[sx]+x;
+ w = TWO23[sx] + math_opt_barrier (x);
t = w-TWO23[sx];
math_force_eval (t);
libc_fesetenvf (&env);
Index: glibc-2.26/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
===================================================================
--- glibc-2.26.orig/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
+++ glibc-2.26/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
@@ -45,7 +45,7 @@ _Float128 __nearbyintl(_Float128 x)
if(j0<112) {
if(j0<0) {
feholdexcept (&env);
- w = TWO112[sx]+x;
+ w = TWO112[sx] + math_opt_barrier (x);
t = w-TWO112[sx];
math_force_eval (t);
fesetenv (&env);
@@ -58,7 +58,7 @@ _Float128 __nearbyintl(_Float128 x)
else return x; /* x is integral */
}
feholdexcept (&env);
- w = TWO112[sx]+x;
+ w = TWO112[sx] + math_opt_barrier (x);
t = w-TWO112[sx];
math_force_eval (t);
fesetenv (&env);