From f6ce9294b0a6c5a847109cc41b7ad0c838b9ccfe Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 26 Oct 2011 11:19:35 +0200 Subject: [PATCH] Make math_force_eval accept non-addressable arguments --- ChangeLog | 6 ++++++ math/math_private.h | 5 +++-- sysdeps/i386/fpu/math_private.h | 7 ++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 23dab2e137..68f7766119 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-10-26 Andreas Schwab + + * math/math_private.h (math_force_eval): Allow non-addressable + arguments. + * sysdeps/i386/fpu/math_private.h (math_force_eval): Likewise. + 2011-10-25 Ulrich Drepper * sysdeps/ieee754/dbl-64/e_rem_pio2.c: Comment everything out, the diff --git a/math/math_private.h b/math/math_private.h index 4cb81ea418..04c112fd60 100644 --- a/math/math_private.h +++ b/math/math_private.h @@ -354,8 +354,9 @@ extern void __docos (double __x, double __dx, double __v[]); #ifndef math_opt_barrier #define math_opt_barrier(x) \ -({ __typeof (x) __x = x; __asm ("" : "+m" (__x)); __x; }) -#define math_force_eval(x) __asm __volatile ("" : : "m" (x)) +({ __typeof (x) __x = (x); __asm ("" : "+m" (__x)); __x; }) +#define math_force_eval(x) \ +({ __typeof (x) __x = (x); __asm __volatile ("" : : "m" (__x)); }) #endif diff --git a/sysdeps/i386/fpu/math_private.h b/sysdeps/i386/fpu/math_private.h index a426788ef1..8a51851377 100644 --- a/sysdeps/i386/fpu/math_private.h +++ b/sysdeps/i386/fpu/math_private.h @@ -1,16 +1,17 @@ #ifndef _MATH_PRIVATE_H #define math_opt_barrier(x) \ -({ __typeof(x) __x; \ +({ __typeof (x) __x; \ __asm ("" : "=t" (__x) : "0" (x)); \ __x; }) #define math_force_eval(x) \ do \ { \ + __typeof (x) __x = (x); \ if (sizeof (x) <= sizeof (double)) \ - __asm __volatile ("" : : "m" (x)); \ + __asm __volatile ("" : : "m" (__x)); \ else \ - __asm __volatile ("" : : "f" (x)); \ + __asm __volatile ("" : : "f" (__x)); \ } \ while (0) -- 2.43.5