From 8f92bd5117812baeda7e9a689453bb2d27d9a776 Mon Sep 17 00:00:00 2001 From: wawa Date: Wed, 26 Sep 2018 16:01:19 +0000 Subject: [PATCH] an update to previous patch fixes nearly all remaining constants used in the math code. (NicJA) git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@55468 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- compiler/stdc/math/e_acos.c | 4 ++-- compiler/stdc/math/e_acosf.c | 4 ++-- compiler/stdc/math/e_acosl.c | 6 +++--- compiler/stdc/math/e_atan2.c | 8 ++++---- compiler/stdc/math/e_atan2f.c | 8 ++++---- compiler/stdc/math/e_atan2l.c | 10 +++++----- compiler/stdc/math/e_exp.c | 6 +++--- compiler/stdc/math/e_expf.c | 6 +++--- compiler/stdc/math/e_j0.c | 2 +- compiler/stdc/math/e_j0f.c | 2 +- compiler/stdc/math/e_j1.c | 2 +- compiler/stdc/math/e_j1f.c | 2 +- compiler/stdc/math/e_jn.c | 2 +- compiler/stdc/math/e_jnf.c | 2 +- compiler/stdc/math/e_lgamma_r.c | 2 +- compiler/stdc/math/e_lgammaf_r.c | 2 +- compiler/stdc/math/e_log.c | 2 +- compiler/stdc/math/e_log10.c | 2 +- compiler/stdc/math/e_log10f.c | 2 +- compiler/stdc/math/e_log2.c | 2 +- compiler/stdc/math/e_log2f.c | 2 +- compiler/stdc/math/e_logf.c | 2 +- compiler/stdc/math/k_sincosl.h | 8 ++++---- compiler/stdc/math/ld128/e_expl.c | 2 +- compiler/stdc/math/ld128/e_lgammal_r.c | 2 +- compiler/stdc/math/ld128/s_erfl.c | 2 +- compiler/stdc/math/ld128/s_exp2l.c | 6 +++--- compiler/stdc/math/ld80/e_expl.c | 8 ++++---- compiler/stdc/math/ld80/e_lgammal_r.c | 2 +- compiler/stdc/math/ld80/e_log10l.c | 12 ++++++------ compiler/stdc/math/ld80/e_log2l.c | 12 ++++++------ compiler/stdc/math/ld80/e_logl.c | 12 ++++++------ compiler/stdc/math/ld80/e_powl.c | 2 +- compiler/stdc/math/ld80/e_rem_pio2l.h | 16 ++++++++-------- compiler/stdc/math/ld80/e_tgammal.c | 20 ++++++++++---------- compiler/stdc/math/ld80/k_cosl.c | 4 ++-- compiler/stdc/math/ld80/k_sinl.c | 4 ++-- compiler/stdc/math/ld80/k_tanl.c | 20 ++++++++++---------- compiler/stdc/math/ld80/s_erfl.c | 2 +- compiler/stdc/math/ld80/s_exp2l.c | 6 +++--- compiler/stdc/math/ld80/s_log1pl.c | 12 ++++++------ compiler/stdc/math/s_atan.c | 2 +- compiler/stdc/math/s_erf.c | 2 +- compiler/stdc/math/s_erff.c | 2 +- compiler/stdc/math/s_exp2.c | 6 +++--- compiler/stdc/math/s_exp2f.c | 6 +++--- compiler/stdc/math/s_expm1f.c | 2 +- compiler/stdc/math/s_log1p.c | 2 +- compiler/stdc/math/s_log1pf.c | 2 +- compiler/stdc/math/s_tanh.c | 2 +- compiler/stdc/math/s_tanhf.c | 2 +- 51 files changed, 130 insertions(+), 130 deletions(-) diff --git a/compiler/stdc/math/e_acos.c b/compiler/stdc/math/e_acos.c index 833e5a3ebb..9891eeab78 100644 --- a/compiler/stdc/math/e_acos.c +++ b/compiler/stdc/math/e_acos.c @@ -47,8 +47,8 @@ static const double one= 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */ pio2_hi = 1.57079632679489655800e+00; /* 0x3FF921FB, 0x54442D18 */ -static volatile double -pio2_lo = 6.12323399573676603587e-17; /* 0x3C91A626, 0x33145C07 */ +static const volatile double +pio2_lo __attribute__ ((__section__(".rodata"))) = 6.12323399573676603587e-17; /* 0x3C91A626, 0x33145C07 */ static const double pS0 = 1.66666666666666657415e-01, /* 0x3FC55555, 0x55555555 */ pS1 = -3.25565818622400915405e-01, /* 0xBFD4D612, 0x03EB6F7D */ diff --git a/compiler/stdc/math/e_acosf.c b/compiler/stdc/math/e_acosf.c index db3a929892..53b3442377 100644 --- a/compiler/stdc/math/e_acosf.c +++ b/compiler/stdc/math/e_acosf.c @@ -24,8 +24,8 @@ static const float one = 1.0000000000e+00, /* 0x3F800000 */ pi = 3.1415925026e+00, /* 0x40490fda */ pio2_hi = 1.5707962513e+00; /* 0x3fc90fda */ -static volatile float -pio2_lo = 7.5497894159e-08; /* 0x33a22168 */ +static const volatile float +pio2_lo __attribute__ ((__section__(".rodata"))) = 7.5497894159e-08; /* 0x33a22168 */ static const float pS0 = 1.6666586697e-01, pS1 = -4.2743422091e-02, diff --git a/compiler/stdc/math/e_acosl.c b/compiler/stdc/math/e_acosl.c index 1409172690..d61a0c5640 100644 --- a/compiler/stdc/math/e_acosl.c +++ b/compiler/stdc/math/e_acosl.c @@ -29,9 +29,9 @@ one= 1.00000000000000000000e+00; #ifdef __i386__ /* XXX Work around the fact that gcc truncates long double constants on i386 */ -static volatile double -pi1 = 3.14159265358979311600e+00, /* 0x1.921fb54442d18p+1 */ -pi2 = 1.22514845490862001043e-16; /* 0x1.1a80000000000p-53 */ +static const volatile double +pi1 __attribute__ ((__section__(".rodata"))) = 3.14159265358979311600e+00, /* 0x1.921fb54442d18p+1 */ +pi2 __attribute__ ((__section__(".rodata"))) = 1.22514845490862001043e-16; /* 0x1.1a80000000000p-53 */ #define pi ((long double)pi1 + pi2) #else static const long double diff --git a/compiler/stdc/math/e_atan2.c b/compiler/stdc/math/e_atan2.c index 1f4692bebf..145da500b0 100644 --- a/compiler/stdc/math/e_atan2.c +++ b/compiler/stdc/math/e_atan2.c @@ -47,15 +47,15 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_atan2.c,v 1.14 2008/08/02 19 #include "math.h" #include "math_private.h" -static volatile double -tiny = 1.0e-300; +static const volatile double +tiny __attribute__ ((__section__(".rodata"))) = 1.0e-300; static const double zero = 0.0, pi_o_4 = 7.8539816339744827900E-01, /* 0x3FE921FB, 0x54442D18 */ pi_o_2 = 1.5707963267948965580E+00, /* 0x3FF921FB, 0x54442D18 */ pi = 3.1415926535897931160E+00; /* 0x400921FB, 0x54442D18 */ -static volatile double -pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */ +static const volatile double +pi_lo __attribute__ ((__section__(".rodata"))) = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */ double __ieee754_atan2(double y, double x) diff --git a/compiler/stdc/math/e_atan2f.c b/compiler/stdc/math/e_atan2f.c index 419e2c3aba..73d872ae8b 100644 --- a/compiler/stdc/math/e_atan2f.c +++ b/compiler/stdc/math/e_atan2f.c @@ -20,15 +20,15 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_atan2f.c,v 1.12 2008/08/03 1 #include "math.h" #include "math_private.h" -static volatile float -tiny = 1.0e-30; +static const volatile float +tiny __attribute__ ((__section__(".rodata"))) = 1.0e-30; static const float zero = 0.0, pi_o_4 = 7.8539818525e-01, /* 0x3f490fdb */ pi_o_2 = 1.5707963705e+00, /* 0x3fc90fdb */ pi = 3.1415927410e+00; /* 0x40490fdb */ -static volatile float -pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */ +static const volatile float +pi_lo __attribute__ ((__section__(".rodata"))) = -8.7422776573e-08; /* 0xb3bbbd2e */ float __ieee754_atan2f(float y, float x) diff --git a/compiler/stdc/math/e_atan2l.c b/compiler/stdc/math/e_atan2l.c index 70faeaf176..deea300aa0 100644 --- a/compiler/stdc/math/e_atan2l.c +++ b/compiler/stdc/math/e_atan2l.c @@ -19,16 +19,16 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_atan2l.c,v 1.3 2008/08/02 19 #include "invtrig.h" #include "math_private.h" -static volatile long double -tiny = 1.0e-300; +static const volatile long double +tiny __attribute__ ((__section__(".rodata"))) = 1.0e-300; static const long double zero = 0.0; #ifdef __i386__ /* XXX Work around the fact that gcc truncates long double constants on i386 */ -static volatile double -pi1 = 3.14159265358979311600e+00, /* 0x1.921fb54442d18p+1 */ -pi2 = 1.22514845490862001043e-16; /* 0x1.1a80000000000p-53 */ +static const volatile double +pi1 __attribute__ ((__section__(".rodata"))) = 3.14159265358979311600e+00, /* 0x1.921fb54442d18p+1 */ +pi2 __attribute__ ((__section__(".rodata"))) = 1.22514845490862001043e-16; /* 0x1.1a80000000000p-53 */ #define pi ((long double)pi1 + pi2) #else static const long double diff --git a/compiler/stdc/math/e_exp.c b/compiler/stdc/math/e_exp.c index 5b04a9f48f..4cc1daf8c9 100644 --- a/compiler/stdc/math/e_exp.c +++ b/compiler/stdc/math/e_exp.c @@ -97,9 +97,9 @@ P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */ P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */ P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */ -static volatile double -huge = 1.0e+300, -twom1000= 9.33263618503218878990e-302; /* 2**-1000=0x01700000,0*/ +static const volatile double +huge __attribute__ ((__section__(".rodata"))) = 1.0e+300, +twom1000 __attribute__ ((__section__(".rodata"))) = 9.33263618503218878990e-302; /* 2**-1000=0x01700000,0*/ double __ieee754_exp(double x) /* default IEEE double exp */ diff --git a/compiler/stdc/math/e_expf.c b/compiler/stdc/math/e_expf.c index a2ca904c23..f79e9d4322 100644 --- a/compiler/stdc/math/e_expf.c +++ b/compiler/stdc/math/e_expf.c @@ -37,9 +37,9 @@ invln2 = 1.4426950216e+00, /* 0x3fb8aa3b */ P1 = 1.6666625440e-1, /* 0xaaaa8f.0p-26 */ P2 = -2.7667332906e-3; /* -0xb55215.0p-32 */ -static volatile float -huge = 1.0e+30, -twom100 = 7.8886090522e-31; /* 2**-100=0x0d800000 */ +static const volatile float +huge __attribute__ ((__section__(".rodata"))) = 1.0e+30, +twom100 __attribute__ ((__section__(".rodata"))) = 7.8886090522e-31; /* 2**-100=0x0d800000 */ float __ieee754_expf(float x) /* default IEEE double exp */ diff --git a/compiler/stdc/math/e_j0.c b/compiler/stdc/math/e_j0.c index 00579d4c8d..0c006305db 100644 --- a/compiler/stdc/math/e_j0.c +++ b/compiler/stdc/math/e_j0.c @@ -67,7 +67,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_j0.c,v 1.9 2008/02/22 02:30: static __inline double pzero(double), qzero(double); -static const volatile double vone = 1, vzero = 0; +static const volatile double vone __attribute__ ((__section__(".rodata"))) = 1, vzero __attribute__ ((__section__(".rodata"))) = 0; static const double huge = 1e300, diff --git a/compiler/stdc/math/e_j0f.c b/compiler/stdc/math/e_j0f.c index 22a37d02c6..cd8cb19e2a 100644 --- a/compiler/stdc/math/e_j0f.c +++ b/compiler/stdc/math/e_j0f.c @@ -26,7 +26,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_j0f.c,v 1.7 2002/05/28 18:15 static __inline float pzerof(float), qzerof(float); -static const volatile float vone = 1, vzero = 0; +static const volatile float vone __attribute__ ((__section__(".rodata"))) = 1, vzero __attribute__ ((__section__(".rodata"))) = 0; static const float huge = 1e30, diff --git a/compiler/stdc/math/e_j1.c b/compiler/stdc/math/e_j1.c index faa130229e..0b93f1e666 100644 --- a/compiler/stdc/math/e_j1.c +++ b/compiler/stdc/math/e_j1.c @@ -67,7 +67,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_j1.c,v 1.9 2008/02/22 02:30: static __inline double pone(double), qone(double); -static const volatile double vone = 1, vzero = 0; +static const volatile double vone __attribute__ ((__section__(".rodata"))) = 1, vzero __attribute__ ((__section__(".rodata"))) = 0; static const double huge = 1e300, diff --git a/compiler/stdc/math/e_j1f.c b/compiler/stdc/math/e_j1f.c index d6adeda0db..c875fe8821 100644 --- a/compiler/stdc/math/e_j1f.c +++ b/compiler/stdc/math/e_j1f.c @@ -26,7 +26,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_j1f.c,v 1.7 2002/05/28 18:15 static __inline float ponef(float), qonef(float); -static const volatile float vone = 1, vzero = 0; +static const volatile float vone __attribute__ ((__section__(".rodata"))) = 1, vzero __attribute__ ((__section__(".rodata"))) = 0; static const float huge = 1e30, diff --git a/compiler/stdc/math/e_jn.c b/compiler/stdc/math/e_jn.c index f2574abe2c..e4d9cd2211 100644 --- a/compiler/stdc/math/e_jn.c +++ b/compiler/stdc/math/e_jn.c @@ -44,7 +44,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_jn.c,v 1.11 2010/11/13 10:54 #include "math.h" #include "math_private.h" -static const volatile double vone = 1, vzero = 0; +static const volatile double vone __attribute__ ((__section__(".rodata"))) = 1, vzero __attribute__ ((__section__(".rodata"))) = 0; static const double invsqrtpi= 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */ diff --git a/compiler/stdc/math/e_jnf.c b/compiler/stdc/math/e_jnf.c index a07e151ac4..82d29c3517 100644 --- a/compiler/stdc/math/e_jnf.c +++ b/compiler/stdc/math/e_jnf.c @@ -24,7 +24,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_jnf.c,v 1.11 2010/11/13 10:5 #include "math.h" #include "math_private.h" -static const volatile float vone = 1, vzero = 0; +static const volatile float vone __attribute__ ((__section__(".rodata"))) = 1, vzero __attribute__ ((__section__(".rodata"))) = 0; static const float two = 2.0000000000e+00, /* 0x40000000 */ diff --git a/compiler/stdc/math/e_lgamma_r.c b/compiler/stdc/math/e_lgamma_r.c index 2d67e28842..139fad72d7 100644 --- a/compiler/stdc/math/e_lgamma_r.c +++ b/compiler/stdc/math/e_lgamma_r.c @@ -87,7 +87,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_lgamma_r.c,v 1.11 2011/10/15 #include "math.h" #include "math_private.h" -static const volatile double vzero = 0; +static const volatile double vzero __attribute__ ((__section__(".rodata"))) = 0; static const double zero= 0.00000000000000000000e+00, diff --git a/compiler/stdc/math/e_lgammaf_r.c b/compiler/stdc/math/e_lgammaf_r.c index c0da257467..4abc3867b9 100644 --- a/compiler/stdc/math/e_lgammaf_r.c +++ b/compiler/stdc/math/e_lgammaf_r.c @@ -20,7 +20,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_lgammaf_r.c,v 1.12 2011/10/1 #include "math.h" #include "math_private.h" -static const volatile float vzero = 0; +static const volatile float vzero __attribute__ ((__section__(".rodata"))) = 0; static const float zero= 0, diff --git a/compiler/stdc/math/e_log.c b/compiler/stdc/math/e_log.c index 8edbc86a2a..e03d9867df 100644 --- a/compiler/stdc/math/e_log.c +++ b/compiler/stdc/math/e_log.c @@ -83,7 +83,7 @@ Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */ Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ static const double zero = 0.0; -static const volatile double vzero = 0.0; +static const volatile double vzero __attribute__ ((__section__(".rodata"))) = 0.0; double __ieee754_log(double x) diff --git a/compiler/stdc/math/e_log10.c b/compiler/stdc/math/e_log10.c index d8fc600bba..0148656b7b 100644 --- a/compiler/stdc/math/e_log10.c +++ b/compiler/stdc/math/e_log10.c @@ -36,7 +36,7 @@ log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */ log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */ static const double zero = 0.0; -static const volatile double vzero = 0.0; +static const volatile double vzero __attribute__ ((__section__(".rodata"))) = 0.0; double __ieee754_log10(double x) diff --git a/compiler/stdc/math/e_log10f.c b/compiler/stdc/math/e_log10f.c index 733d6c1ae7..cbe14d03f1 100644 --- a/compiler/stdc/math/e_log10f.c +++ b/compiler/stdc/math/e_log10f.c @@ -33,7 +33,7 @@ log10_2hi = 3.0102920532e-01, /* 0x3e9a2080 */ log10_2lo = 7.9034151668e-07; /* 0x355427db */ static const float zero = 0.0; -static const volatile float vzero = 0.0; +static const volatile float vzero __attribute__ ((__section__(".rodata"))) = 0.0; float __ieee754_log10f(float x) diff --git a/compiler/stdc/math/e_log2.c b/compiler/stdc/math/e_log2.c index e24cb0646e..06ed4960a3 100644 --- a/compiler/stdc/math/e_log2.c +++ b/compiler/stdc/math/e_log2.c @@ -36,7 +36,7 @@ ivln2hi = 1.44269504072144627571e+00, /* 0x3ff71547, 0x65200000 */ ivln2lo = 1.67517131648865118353e-10; /* 0x3de705fc, 0x2eefa200 */ static const double zero = 0.0; -static const volatile double vzero = 0.0; +static const volatile double vzero __attribute__ ((__section__(".rodata"))) = 0.0; double __ieee754_log2(double x) diff --git a/compiler/stdc/math/e_log2f.c b/compiler/stdc/math/e_log2f.c index 45766fc80c..20888d7f3a 100644 --- a/compiler/stdc/math/e_log2f.c +++ b/compiler/stdc/math/e_log2f.c @@ -30,7 +30,7 @@ ivln2hi = 1.4428710938e+00, /* 0x3fb8b000 */ ivln2lo = -1.7605285393e-04; /* 0xb9389ad4 */ static const float zero = 0.0; -static const volatile float vzero = 0.0; +static const volatile float vzero __attribute__ ((__section__(".rodata"))) = 0.0; float __ieee754_log2f(float x) diff --git a/compiler/stdc/math/e_logf.c b/compiler/stdc/math/e_logf.c index 1b077ce4ba..295d207f7d 100644 --- a/compiler/stdc/math/e_logf.c +++ b/compiler/stdc/math/e_logf.c @@ -31,7 +31,7 @@ Lg3 = 0x91e9ee.0p-25, /* 0.28498786688 */ Lg4 = 0xf89e26.0p-26; /* 0.24279078841 */ static const float zero = 0.0; -static const volatile float vzero = 0.0; +static const volatile float vzero __attribute__ ((__section__(".rodata"))) = 0.0; float __ieee754_logf(float x) diff --git a/compiler/stdc/math/k_sincosl.h b/compiler/stdc/math/k_sincosl.h index 8ce0ee030c..52eb0412ee 100644 --- a/compiler/stdc/math/k_sincosl.h +++ b/compiler/stdc/math/k_sincosl.h @@ -19,10 +19,10 @@ #if defined(__amd64__) || defined(__i386__) /* Long double constants are slow on these arches, and broken on i386. */ static const volatile double -C1hi = 0.041666666666666664, /* 0x15555555555555.0p-57 */ -C1lo = 2.2598839032744733e-18, /* 0x14d80000000000.0p-111 */ -S1hi = -0.16666666666666666, /* -0x15555555555555.0p-55 */ -S1lo = -9.2563760475949941e-18; /* -0x15580000000000.0p-109 */ +C1hi __attribute__ ((__section__(".rodata"))) = 0.041666666666666664, /* 0x15555555555555.0p-57 */ +C1lo __attribute__ ((__section__(".rodata"))) = 2.2598839032744733e-18, /* 0x14d80000000000.0p-111 */ +S1hi __attribute__ ((__section__(".rodata"))) = -0.16666666666666666, /* -0x15555555555555.0p-55 */ +S1lo __attribute__ ((__section__(".rodata"))) = -9.2563760475949941e-18; /* -0x15580000000000.0p-109 */ #define S1 ((long double)S1hi + S1lo) #define C1 ((long double)C1hi + C1lo) #else diff --git a/compiler/stdc/math/ld128/e_expl.c b/compiler/stdc/math/ld128/e_expl.c index 5b7469bfba..0e35efa904 100644 --- a/compiler/stdc/math/ld128/e_expl.c +++ b/compiler/stdc/math/ld128/e_expl.c @@ -107,7 +107,7 @@ static const long double huge = 0x1p10000L; #if 0 /* XXX Prevent gcc from erroneously constant folding this. */ static const long double twom10000 = 0x1p-10000L; #else -static volatile long double twom10000 = 0x1p-10000L; +static const volatile long double twom10000 __attribute__ ((__section__(".rodata"))) = 0x1p-10000L; #endif long double diff --git a/compiler/stdc/math/ld128/e_lgammal_r.c b/compiler/stdc/math/ld128/e_lgammal_r.c index 00656b70ba..e653ca2a49 100644 --- a/compiler/stdc/math/ld128/e_lgammal_r.c +++ b/compiler/stdc/math/ld128/e_lgammal_r.c @@ -22,7 +22,7 @@ #include "math.h" #include "math_private.h" -static const volatile double vzero = 0; +static const volatile double vzero __attribute__ ((__section__(".rodata"))) = 0; static const double zero= 0, diff --git a/compiler/stdc/math/ld128/s_erfl.c b/compiler/stdc/math/ld128/s_erfl.c index f7cdef7cf8..11355afd83 100644 --- a/compiler/stdc/math/ld128/s_erfl.c +++ b/compiler/stdc/math/ld128/s_erfl.c @@ -24,7 +24,7 @@ #include "math_private.h" /* XXX Prevent compilers from erroneously constant folding these: */ -static const volatile long double tiny = 0x1p-10000L; +static const volatile long double tiny __attribute__ ((__section__(".rodata"))) = 0x1p-10000L; static const double half= 0.5, diff --git a/compiler/stdc/math/ld128/s_exp2l.c b/compiler/stdc/math/ld128/s_exp2l.c index 2eba583eec..185c2894d6 100644 --- a/compiler/stdc/math/ld128/s_exp2l.c +++ b/compiler/stdc/math/ld128/s_exp2l.c @@ -40,9 +40,9 @@ #define BIAS (LDBL_MAX_EXP - 1) #define EXPMASK (BIAS + LDBL_MAX_EXP) -static volatile long double - huge = 0x1p10000L, - twom10000 = 0x1p-10000L; +static const volatile long double + huge __attribute__ ((__section__(".rodata"))) = 0x1p10000L, + twom10000 __attribute__ ((__section__(".rodata"))) = 0x1p-10000L; static const long double P1 = 0x1.62e42fefa39ef35793c7673007e6p-1L, diff --git a/compiler/stdc/math/ld80/e_expl.c b/compiler/stdc/math/ld80/e_expl.c index 9904cd92b8..7ad5cb8b71 100644 --- a/compiler/stdc/math/ld80/e_expl.c +++ b/compiler/stdc/math/ld80/e_expl.c @@ -76,12 +76,12 @@ #include "math_private.h" -static long double P[3] = { +static const long double P[3] = { 1.2617719307481059087798E-4L, 3.0299440770744196129956E-2L, 9.9999999999999999991025E-1L, }; -static long double Q[4] = { +static const long double Q[4] = { 3.0019850513866445504159E-6L, 2.5244834034968410419224E-3L, 2.2726554820815502876593E-1L, @@ -122,8 +122,8 @@ x -= px * C2; * e**x = 1 + 2x P(x**2)/( Q(x**2) - P(x**2) ) */ xx = x * x; -px = x * __polevll( xx, P, 2 ); -x = px/( __polevll( xx, Q, 3 ) - px ); +px = x * __polevll( xx, (void *)P, 2 ); +x = px/( __polevll( xx, (void *)Q, 3 ) - px ); x = 1.0L + ldexpl( x, 1 ); x = ldexpl( x, n ); diff --git a/compiler/stdc/math/ld80/e_lgammal_r.c b/compiler/stdc/math/ld80/e_lgammal_r.c index e1c89c8b7a..8a4694b7f0 100644 --- a/compiler/stdc/math/ld80/e_lgammal_r.c +++ b/compiler/stdc/math/ld80/e_lgammal_r.c @@ -28,7 +28,7 @@ #include "i386/ieeefp.h" #endif -static const volatile double vzero = 0; +static const volatile double vzero __attribute__ ((__section__(".rodata"))) = 0; static const double zero= 0, diff --git a/compiler/stdc/math/ld80/e_log10l.c b/compiler/stdc/math/ld80/e_log10l.c index 035a2379c0..817295cbba 100644 --- a/compiler/stdc/math/ld80/e_log10l.c +++ b/compiler/stdc/math/ld80/e_log10l.c @@ -71,7 +71,7 @@ * 1/sqrt(2) <= x < sqrt(2) * Theoretical peak relative error = 6.2e-22 */ -static long double P[] = { +static const long double P[] = { 4.9962495940332550844739E-1L, 1.0767376367209449010438E1L, 7.7671073698359539859595E1L, @@ -80,7 +80,7 @@ static long double P[] = { 3.4258224542413922935104E2L, 1.0747524399916215149070E2L, }; -static long double Q[] = { +static const long double Q[] = { /* 1.0000000000000000000000E0,*/ 2.3479774160285863271658E1L, 1.9444210022760132894510E2L, @@ -97,13 +97,13 @@ static long double Q[] = { * Theoretical peak relative error = 6.16e-22 */ -static long double R[4] = { +static const long double R[4] = { 1.9757429581415468984296E-3L, -7.1990767473014147232598E-1L, 1.0777257190312272158094E1L, -3.5717684488096787370998E1L, }; -static long double S[4] = { +static const long double S[4] = { /* 1.00000000000000000000E0L,*/ -2.6201045551331104417768E1L, 1.9361891836232102174846E2L, @@ -164,7 +164,7 @@ else } x = z / y; z = x*x; -y = x * ( z * __polevll( z, R, 3 ) / __p1evll( z, S, 3 ) ); +y = x * ( z * __polevll( z, (void *)R, 3 ) / __p1evll( z, (void *)S, 3 ) ); goto done; } @@ -181,7 +181,7 @@ else x = x - 1.0L; } z = x*x; -y = x * ( z * __polevll( x, P, 6 ) / __p1evll( x, Q, 7 ) ); +y = x * ( z * __polevll( x, (void *)P, 6 ) / __p1evll( x, (void *)Q, 7 ) ); y = y - ldexpl( z, -1 ); /* -0.5x^2 + ... */ done: diff --git a/compiler/stdc/math/ld80/e_log2l.c b/compiler/stdc/math/ld80/e_log2l.c index 5a36d0a1f5..ee2c5c1916 100644 --- a/compiler/stdc/math/ld80/e_log2l.c +++ b/compiler/stdc/math/ld80/e_log2l.c @@ -71,7 +71,7 @@ * 1/sqrt(2) <= x < sqrt(2) * Theoretical peak relative error = 6.2e-22 */ -static long double P[] = { +static const long double P[] = { 4.9962495940332550844739E-1L, 1.0767376367209449010438E1L, 7.7671073698359539859595E1L, @@ -80,7 +80,7 @@ static long double P[] = { 3.4258224542413922935104E2L, 1.0747524399916215149070E2L, }; -static long double Q[] = { +static const long double Q[] = { /* 1.0000000000000000000000E0,*/ 2.3479774160285863271658E1L, 1.9444210022760132894510E2L, @@ -96,13 +96,13 @@ static long double Q[] = { * 1/sqrt(2) <= x < sqrt(2) * Theoretical peak relative error = 6.16e-22 */ -static long double R[4] = { +static const long double R[4] = { 1.9757429581415468984296E-3L, -7.1990767473014147232598E-1L, 1.0777257190312272158094E1L, -3.5717684488096787370998E1L, }; -static long double S[4] = { +static const long double S[4] = { /* 1.00000000000000000000E0L,*/ -2.6201045551331104417768E1L, 1.9361891836232102174846E2L, @@ -160,7 +160,7 @@ else } x = z / y; z = x*x; -y = x * ( z * __polevll( z, R, 3 ) / __p1evll( z, S, 3 ) ); +y = x * ( z * __polevll( z, (void *)R, 3 ) / __p1evll( z, (void *)S, 3 ) ); goto done; } @@ -177,7 +177,7 @@ else x = x - 1.0L; } z = x*x; -y = x * ( z * __polevll( x, P, 6 ) / __p1evll( x, Q, 7 ) ); +y = x * ( z * __polevll( x, (void *)P, 6 ) / __p1evll( x, (void *)Q, 7 ) ); y = y - ldexpl( z, -1 ); /* -0.5x^2 + ... */ done: diff --git a/compiler/stdc/math/ld80/e_logl.c b/compiler/stdc/math/ld80/e_logl.c index 3bb7fb9005..9ea8f1b704 100644 --- a/compiler/stdc/math/ld80/e_logl.c +++ b/compiler/stdc/math/ld80/e_logl.c @@ -71,7 +71,7 @@ * 1/sqrt(2) <= x < sqrt(2) * Theoretical peak relative error = 2.32e-20 */ -static long double P[] = { +static const long double P[] = { 4.5270000862445199635215E-5L, 4.9854102823193375972212E-1L, 6.5787325942061044846969E0L, @@ -80,7 +80,7 @@ static long double P[] = { 5.7112963590585538103336E1L, 2.0039553499201281259648E1L, }; -static long double Q[] = { +static const long double Q[] = { /* 1.0000000000000000000000E0,*/ 1.5062909083469192043167E1L, 8.3047565967967209469434E1L, @@ -96,13 +96,13 @@ static long double Q[] = { * Theoretical peak relative error = 6.16e-22 */ -static long double R[4] = { +static const long double R[4] = { 1.9757429581415468984296E-3L, -7.1990767473014147232598E-1L, 1.0777257190312272158094E1L, -3.5717684488096787370998E1L, }; -static long double S[4] = { +static const long double S[4] = { /* 1.00000000000000000000E0L,*/ -2.6201045551331104417768E1L, 1.9361891836232102174846E2L, @@ -158,7 +158,7 @@ else } x = z / y; z = x*x; -z = x * ( z * __polevll( z, R, 3 ) / __p1evll( z, S, 3 ) ); +z = x * ( z * __polevll( z, (void *)R, 3 ) / __p1evll( z, (void *)S, 3 ) ); z = z + e * C2; z = z + x; z = z + e * C1; @@ -178,7 +178,7 @@ else x = x - 1.0L; } z = x*x; -y = x * ( z * __polevll( x, P, 6 ) / __p1evll( x, Q, 6 ) ); +y = x * ( z * __polevll( x, (void *)P, 6 ) / __p1evll( x, (void *)Q, 6 ) ); y = y + e * C2; z = y - ldexpl( z, -1 ); /* y - 0.5 * z */ /* Note, the sum of above terms does not exceed x/4, diff --git a/compiler/stdc/math/ld80/e_powl.c b/compiler/stdc/math/ld80/e_powl.c index 9942f92b91..5058da0aca 100644 --- a/compiler/stdc/math/ld80/e_powl.c +++ b/compiler/stdc/math/ld80/e_powl.c @@ -194,7 +194,7 @@ static const long double huge = 0x1p10000L; #if 0 /* XXX Prevent gcc from erroneously constant folding this. */ static const long double twom10000 = 0x1p-10000L; #else -static volatile long double twom10000 = 0x1p-10000L; +static const volatile long double twom10000 __attribute__ ((__section__(".rodata"))) = 0x1p-10000L; #endif static long double reducl( long double ); diff --git a/compiler/stdc/math/ld80/e_rem_pio2l.h b/compiler/stdc/math/ld80/e_rem_pio2l.h index d990e23144..8a15190908 100644 --- a/compiler/stdc/math/ld80/e_rem_pio2l.h +++ b/compiler/stdc/math/ld80/e_rem_pio2l.h @@ -48,14 +48,14 @@ pio2_3 = 6.36831716351370313614e-25; /* 0x18a2e037074000.0p-133 */ #if defined(__amd64__) || defined(__i386__) /* Long double constants are slow on these arches, and broken on i386. */ static const volatile double -invpio2hi = 6.3661977236758138e-01, /* 0x145f306dc9c883.0p-53 */ -invpio2lo = -3.9356538861223811e-17, /* -0x16b00000000000.0p-107 */ -pio2_1thi = -1.0746346554971943e-12, /* -0x12e7b9676733af.0p-92 */ -pio2_1tlo = 8.8451028997905949e-29, /* 0x1c080000000000.0p-146 */ -pio2_2thi = 6.3683171635109499e-25, /* 0x18a2e03707344a.0p-133 */ -pio2_2tlo = 2.3183081793789774e-41, /* 0x10280000000000.0p-187 */ -pio2_3thi = -2.7529965190440717e-37, /* -0x176b7ed8fbbacc.0p-174 */ -pio2_3tlo = -4.2006647512740502e-54; /* -0x19c00000000000.0p-230 */ +invpio2hi __attribute__ ((__section__(".rodata"))) = 6.3661977236758138e-01, /* 0x145f306dc9c883.0p-53 */ +invpio2lo __attribute__ ((__section__(".rodata"))) = -3.9356538861223811e-17, /* -0x16b00000000000.0p-107 */ +pio2_1thi __attribute__ ((__section__(".rodata"))) = -1.0746346554971943e-12, /* -0x12e7b9676733af.0p-92 */ +pio2_1tlo __attribute__ ((__section__(".rodata"))) = 8.8451028997905949e-29, /* 0x1c080000000000.0p-146 */ +pio2_2thi __attribute__ ((__section__(".rodata"))) = 6.3683171635109499e-25, /* 0x18a2e03707344a.0p-133 */ +pio2_2tlo __attribute__ ((__section__(".rodata"))) = 2.3183081793789774e-41, /* 0x10280000000000.0p-187 */ +pio2_3thi __attribute__ ((__section__(".rodata"))) = -2.7529965190440717e-37, /* -0x176b7ed8fbbacc.0p-174 */ +pio2_3tlo __attribute__ ((__section__(".rodata"))) = -4.2006647512740502e-54; /* -0x19c00000000000.0p-230 */ #define invpio2 ((long double)invpio2hi + invpio2lo) #define pio2_1t ((long double)pio2_1thi + pio2_1tlo) #define pio2_2t ((long double)pio2_2thi + pio2_2tlo) diff --git a/compiler/stdc/math/ld80/e_tgammal.c b/compiler/stdc/math/ld80/e_tgammal.c index 097b4c1536..dda1583332 100644 --- a/compiler/stdc/math/ld80/e_tgammal.c +++ b/compiler/stdc/math/ld80/e_tgammal.c @@ -68,7 +68,7 @@ Peak error = 1.83e-20 Relative error spread = 8.4e-23 */ -static long double P[8] = { +static const long double P[8] = { 4.212760487471622013093E-5L, 4.542931960608009155600E-4L, 4.092666828394035500949E-3L, @@ -78,7 +78,7 @@ static long double P[8] = { 8.378004301573126728826E-1L, 1.000000000000000000009E0L, }; -static long double Q[9] = { +static const long double Q[9] = { -1.397148517476170440917E-5L, 2.346584059160635244282E-4L, -1.237799246653152231188E-3L, @@ -126,7 +126,7 @@ Peak error = 9.44e-21 Relative error spread = 8.8e-4 */ -static long double STIR[9] = { +static const long double STIR[9] = { 7.147391378143610789273E-4L, -2.363848809501759061727E-5L, -5.950237554056330156018E-4L, @@ -147,7 +147,7 @@ static const long double SQTPI = 2.50662827463100050242E0L; * Peak relative error 4.2e-23 */ -static long double S[9] = { +static const long double S[9] = { -1.193945051381510095614E-3L, 7.220599478036909672331E-3L, -9.622023360406271645744E-3L, @@ -166,7 +166,7 @@ static long double S[9] = { * Relative error spread = 2.5e-24 */ -static long double SN[9] = { +static const long double SN[9] = { 1.133374167243894382010E-3L, 7.220837261893170325704E-3L, 9.621911155035976733706E-3L, @@ -199,7 +199,7 @@ if( x > 1024.0L ) + 8.33333333333333333333E-2L) * w + 1.0L; else - w = 1.0L + w * __polevll( w, STIR, 8 ); + w = 1.0L + w * __polevll( w, (void *)STIR, 8 ); y = expl(x); if( x > MAXSTIR ) { /* Avoid overflow in pow() */ @@ -291,8 +291,8 @@ if( x == 2.0L ) return(z); x -= 2.0L; -p = __polevll( x, P, 7 ); -q = __polevll( x, Q, 8 ); +p = __polevll( x, (void *)P, 7 ); +q = __polevll( x, (void *)Q, 8 ); z = z * p / q; return z; @@ -304,10 +304,10 @@ else if( x < 0.0L ) { x = -x; - q = z / (x * __polevll( x, SN, 8 )); + q = z / (x * __polevll( x, (void *)SN, 8 )); } else - q = z / (x * __polevll( x, S, 8 )); + q = z / (x * __polevll( x, (void *)S, 8 )); } return q; } diff --git a/compiler/stdc/math/ld80/k_cosl.c b/compiler/stdc/math/ld80/k_cosl.c index 7e40e95d45..d265ef8fcd 100644 --- a/compiler/stdc/math/ld80/k_cosl.c +++ b/compiler/stdc/math/ld80/k_cosl.c @@ -48,8 +48,8 @@ one = 1.0; #if defined(__amd64__) || defined(__i386__) /* Long double constants are slow on these arches, and broken on i386. */ static const volatile double -C1hi = 0.041666666666666664, /* 0x15555555555555.0p-57 */ -C1lo = 2.2598839032744733e-18; /* 0x14d80000000000.0p-111 */ +C1hi __attribute__ ((__section__(".rodata"))) = 0.041666666666666664, /* 0x15555555555555.0p-57 */ +C1lo __attribute__ ((__section__(".rodata"))) = 2.2598839032744733e-18; /* 0x14d80000000000.0p-111 */ #define C1 ((long double)C1hi + C1lo) #else static const long double diff --git a/compiler/stdc/math/ld80/k_sinl.c b/compiler/stdc/math/ld80/k_sinl.c index dec29fd130..85b4018ead 100644 --- a/compiler/stdc/math/ld80/k_sinl.c +++ b/compiler/stdc/math/ld80/k_sinl.c @@ -31,8 +31,8 @@ half = 0.5; #if defined(__amd64__) || defined(__i386__) /* Long double constants are slow on these arches, and broken on i386. */ static const volatile double -S1hi = -0.16666666666666666, /* -0x15555555555555.0p-55 */ -S1lo = -9.2563760475949941e-18; /* -0x15580000000000.0p-109 */ +S1hi __attribute__ ((__section__(".rodata"))) = -0.16666666666666666, /* -0x15555555555555.0p-55 */ +S1lo __attribute__ ((__section__(".rodata"))) = -9.2563760475949941e-18; /* -0x15580000000000.0p-109 */ #define S1 ((long double)S1hi + S1lo) #else static const long double diff --git a/compiler/stdc/math/ld80/k_tanl.c b/compiler/stdc/math/ld80/k_tanl.c index e448f06fce..e0c48ff216 100644 --- a/compiler/stdc/math/ld80/k_tanl.c +++ b/compiler/stdc/math/ld80/k_tanl.c @@ -30,16 +30,16 @@ #if defined(__amd64__) || defined(__i386__) /* Long double constants are slow on these arches, and broken on i386. */ static const volatile double -T3hi = 0.33333333333333331, /* 0x15555555555555.0p-54 */ -T3lo = 1.8350121769317163e-17, /* 0x15280000000000.0p-108 */ -T5hi = 0.13333333333333336, /* 0x11111111111112.0p-55 */ -T5lo = 1.3051083651294260e-17, /* 0x1e180000000000.0p-109 */ -T7hi = 0.053968253968250494, /* 0x1ba1ba1ba1b827.0p-57 */ -T7lo = 3.1509625637859973e-18, /* 0x1d100000000000.0p-111 */ -pio4_hi = 0.78539816339744828, /* 0x1921fb54442d18.0p-53 */ -pio4_lo = 3.0628711372715500e-17, /* 0x11a80000000000.0p-107 */ -pio4lo_hi = -1.2541394031670831e-20, /* -0x1d9cceba3f91f2.0p-119 */ -pio4lo_lo = 6.1493048227390915e-37; /* 0x1a280000000000.0p-173 */ +T3hi __attribute__ ((__section__(".rodata"))) = 0.33333333333333331, /* 0x15555555555555.0p-54 */ +T3lo __attribute__ ((__section__(".rodata"))) = 1.8350121769317163e-17, /* 0x15280000000000.0p-108 */ +T5hi __attribute__ ((__section__(".rodata"))) = 0.13333333333333336, /* 0x11111111111112.0p-55 */ +T5lo __attribute__ ((__section__(".rodata"))) = 1.3051083651294260e-17, /* 0x1e180000000000.0p-109 */ +T7hi __attribute__ ((__section__(".rodata"))) = 0.053968253968250494, /* 0x1ba1ba1ba1b827.0p-57 */ +T7lo __attribute__ ((__section__(".rodata"))) = 3.1509625637859973e-18, /* 0x1d100000000000.0p-111 */ +pio4_hi __attribute__ ((__section__(".rodata"))) = 0.78539816339744828, /* 0x1921fb54442d18.0p-53 */ +pio4_lo __attribute__ ((__section__(".rodata"))) = 3.0628711372715500e-17, /* 0x11a80000000000.0p-107 */ +pio4lo_hi __attribute__ ((__section__(".rodata"))) = -1.2541394031670831e-20, /* -0x1d9cceba3f91f2.0p-119 */ +pio4lo_lo __attribute__ ((__section__(".rodata"))) = 6.1493048227390915e-37; /* 0x1a280000000000.0p-173 */ #define T3 ((long double)T3hi + T3lo) #define T5 ((long double)T5hi + T5lo) #define T7 ((long double)T7hi + T7lo) diff --git a/compiler/stdc/math/ld80/s_erfl.c b/compiler/stdc/math/ld80/s_erfl.c index 481138236b..83b36418f7 100644 --- a/compiler/stdc/math/ld80/s_erfl.c +++ b/compiler/stdc/math/ld80/s_erfl.c @@ -30,7 +30,7 @@ #endif /* XXX Prevent compilers from erroneously constant folding: */ -static const volatile long double tiny = 0x1p-10000L; +static const volatile long double tiny __attribute__ ((__section__(".rodata"))) = 0x1p-10000L; static const double half= 0.5, diff --git a/compiler/stdc/math/ld80/s_exp2l.c b/compiler/stdc/math/ld80/s_exp2l.c index 151c223f7a..f0ce223860 100644 --- a/compiler/stdc/math/ld80/s_exp2l.c +++ b/compiler/stdc/math/ld80/s_exp2l.c @@ -45,9 +45,9 @@ #define BIAS (LDBL_MAX_EXP - 1) -static volatile long double - huge = 0x1p10000L, - twom10000 = 0x1p-10000L; +static const volatile long double + huge __attribute__ ((__section__(".rodata"))) = 0x1p10000L, + twom10000 __attribute__ ((__section__(".rodata"))) = 0x1p-10000L; static const union IEEEl2bits P1 = LD80C(0xb17217f7d1cf79ac, -1, 6.93147180559945309429e-1L); diff --git a/compiler/stdc/math/ld80/s_log1pl.c b/compiler/stdc/math/ld80/s_log1pl.c index b301af61d5..65cdec8f8a 100644 --- a/compiler/stdc/math/ld80/s_log1pl.c +++ b/compiler/stdc/math/ld80/s_log1pl.c @@ -68,7 +68,7 @@ * Theoretical peak relative error = 2.32e-20 */ -static long double P[] = { +static const long double P[] = { 4.5270000862445199635215E-5L, 4.9854102823193375972212E-1L, 6.5787325942061044846969E0L, @@ -77,7 +77,7 @@ static long double P[] = { 5.7112963590585538103336E1L, 2.0039553499201281259648E1L, }; -static long double Q[] = { +static const long double Q[] = { /* 1.0000000000000000000000E0,*/ 1.5062909083469192043167E1L, 8.3047565967967209469434E1L, @@ -93,13 +93,13 @@ static long double Q[] = { * Theoretical peak relative error = 6.16e-22 */ -static long double R[4] = { +static const long double R[4] = { 1.9757429581415468984296E-3L, -7.1990767473014147232598E-1L, 1.0777257190312272158094E1L, -3.5717684488096787370998E1L, }; -static long double S[4] = { +static const long double S[4] = { /* 1.00000000000000000000E0L,*/ -2.6201045551331104417768E1L, 1.9361891836232102174846E2L, @@ -156,7 +156,7 @@ else } x = z / y; z = x*x; -z = x * ( z * __polevll( z, R, 3 ) / __p1evll( z, S, 3 ) ); +z = x * ( z * __polevll( z, (void *)R, 3 ) / __p1evll( z, (void *)S, 3 ) ); z = z + e * C2; z = z + x; z = z + e * C1; @@ -182,7 +182,7 @@ else x = xm1; } z = x*x; -y = x * ( z * __polevll( x, P, 6 ) / __p1evll( x, Q, 6 ) ); +y = x * ( z * __polevll( x, (void *)P, 6 ) / __p1evll( x, (void *)Q, 6 ) ); y = y + e * C2; z = y - 0.5 * z; z = z + x; diff --git a/compiler/stdc/math/s_atan.c b/compiler/stdc/math/s_atan.c index d5d613d6b0..d68a006dc0 100644 --- a/compiler/stdc/math/s_atan.c +++ b/compiler/stdc/math/s_atan.c @@ -66,7 +66,7 @@ static const double aT[] = { 1.62858201153657823623e-02, /* 0x3F90AD3A, 0xE322DA11 */ }; - static const double +static const double one = 1.0, huge = 1.0e300; diff --git a/compiler/stdc/math/s_erf.c b/compiler/stdc/math/s_erf.c index 7f9c47f381..defc77f591 100644 --- a/compiler/stdc/math/s_erf.c +++ b/compiler/stdc/math/s_erf.c @@ -114,7 +114,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_erf.c,v 1.8 2008/02/22 02:30 #include "math_private.h" /* XXX Prevent compilers from erroneously constant folding: */ -static const volatile double tiny= 1e-300; +static const volatile double tiny __attribute__ ((__section__(".rodata"))) = 1e-300; static const double half= 0.5, diff --git a/compiler/stdc/math/s_erff.c b/compiler/stdc/math/s_erff.c index edb2faa2ba..23375d8b96 100644 --- a/compiler/stdc/math/s_erff.c +++ b/compiler/stdc/math/s_erff.c @@ -21,7 +21,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_erff.c,v 1.8 2008/02/22 02:3 #include "math_private.h" /* XXX Prevent compilers from erroneously constant folding: */ -static const volatile float tiny = 1e-30; +static const volatile float tiny __attribute__ ((__section__(".rodata"))) = 1e-30; static const float half= 0.5, diff --git a/compiler/stdc/math/s_exp2.c b/compiler/stdc/math/s_exp2.c index 221bc52392..9d0d531758 100644 --- a/compiler/stdc/math/s_exp2.c +++ b/compiler/stdc/math/s_exp2.c @@ -43,9 +43,9 @@ static const double P4 = 0x1.3b2ab88f70400p-7, P5 = 0x1.5d88003875c74p-10; -static volatile double - huge = 0x1p1000, - twom1000 = 0x1p-1000; +static const volatile double + huge __attribute__ ((__section__(".rodata"))) = 0x1p1000, + twom1000 __attribute__ ((__section__(".rodata"))) = 0x1p-1000; static const double tbl[TBLSIZE * 2] = { /* exp2(z + eps) eps */ diff --git a/compiler/stdc/math/s_exp2f.c b/compiler/stdc/math/s_exp2f.c index 1c813a7871..73d62388d0 100644 --- a/compiler/stdc/math/s_exp2f.c +++ b/compiler/stdc/math/s_exp2f.c @@ -41,9 +41,9 @@ static const float P3 = 0x1.c6b348p-5f, P4 = 0x1.3b2c9cp-7f; -static volatile float - huge = 0x1p100f, - twom100 = 0x1p-100f; +static const volatile float + huge __attribute__ ((__section__(".rodata"))) = 0x1p100f, + twom100 __attribute__ ((__section__(".rodata"))) = 0x1p-100f; static const double exp2ft[TBLSIZE] = { 0x1.6a09e667f3bcdp-1, diff --git a/compiler/stdc/math/s_expm1f.c b/compiler/stdc/math/s_expm1f.c index 0f456f3ceb..71babaeed5 100644 --- a/compiler/stdc/math/s_expm1f.c +++ b/compiler/stdc/math/s_expm1f.c @@ -35,7 +35,7 @@ invln2 = 1.4426950216e+00,/* 0x3fb8aa3b */ Q1 = -3.3333212137e-2, /* -0x888868.0p-28 */ Q2 = 1.5807170421e-3; /* 0xcf3010.0p-33 */ -static volatile float huge = 1.0e+30; +static const volatile float huge __attribute__ ((__section__(".rodata"))) = 1.0e+30; float expm1f(float x) diff --git a/compiler/stdc/math/s_log1p.c b/compiler/stdc/math/s_log1p.c index 918fa151a3..43665a4e49 100644 --- a/compiler/stdc/math/s_log1p.c +++ b/compiler/stdc/math/s_log1p.c @@ -96,7 +96,7 @@ Lp6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */ Lp7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ static const double zero = 0.0; -static const volatile double vzero = 0.0; +static const volatile double vzero __attribute__ ((__section__(".rodata"))) = 0.0; double log1p(double x) diff --git a/compiler/stdc/math/s_log1pf.c b/compiler/stdc/math/s_log1pf.c index 523856f00c..31fb39653f 100644 --- a/compiler/stdc/math/s_log1pf.c +++ b/compiler/stdc/math/s_log1pf.c @@ -33,7 +33,7 @@ Lp6 = 1.5313838422e-01, /* 3E1CD04F */ Lp7 = 1.4798198640e-01; /* 3E178897 */ static const float zero = 0.0; -static const volatile float vzero = 0.0; +static const volatile float vzero __attribute__ ((__section__(".rodata"))) = 0.0; float log1pf(float x) diff --git a/compiler/stdc/math/s_tanh.c b/compiler/stdc/math/s_tanh.c index 902f45b7be..9b3aa113c1 100644 --- a/compiler/stdc/math/s_tanh.c +++ b/compiler/stdc/math/s_tanh.c @@ -42,7 +42,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_tanh.c,v 1.9 2008/02/22 02:3 #include "math.h" #include "math_private.h" -static const volatile double tiny = 1.0e-300; +static const volatile double tiny __attribute__ ((__section__(".rodata"))) = 1.0e-300; static const double one = 1.0, two = 2.0, huge = 1.0e300; double diff --git a/compiler/stdc/math/s_tanhf.c b/compiler/stdc/math/s_tanhf.c index 22d2292c91..8bd5685a13 100644 --- a/compiler/stdc/math/s_tanhf.c +++ b/compiler/stdc/math/s_tanhf.c @@ -20,7 +20,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_tanhf.c,v 1.9 2008/02/22 02: #include "math.h" #include "math_private.h" -static const volatile float tiny = 1.0e-30; +static const volatile float tiny __attribute__ ((__section__(".rodata"))) = 1.0e-30; static const float one=1.0, two=2.0, huge = 1.0e30; float -- 2.11.4.GIT