summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2009-06-14 11:57:18 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2009-06-14 11:57:18 +0000
commit827c4531844b4640583d8cf87b67f75e1e66afde (patch)
tree42028490a3ad99c5c3eafbf5f2bc9e0408038b36 /acinclude.m4
parent3de621ecfd84020a2dba5e7317df6040a027d147 (diff)
downloadmpfr-827c4531844b4640583d8cf87b67f75e1e66afde.tar.gz
acinclude.m4: Make sure results of calculations on constants used with
the fesetround() test are not precomputed by GCC (occurs on MIPS). Patch from Maciej W. Rozycki. https://sympa.inria.fr/sympa/arc/mpfr/2009-06/msg00036.html http://article.gmane.org/gmane.comp.lib.mpfr.general/174 git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6274 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m47
1 files changed, 4 insertions, 3 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 79d46f065..719b6ccba 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -150,6 +150,7 @@ if test -n "$GCC"; then
static double get_max (void);
int main() {
double x = 0.5;
+ double y;
int i;
for (i = 1; i <= 11; i++)
x *= x;
@@ -158,14 +159,14 @@ int main() {
#ifdef MPFR_HAVE_FESETROUND
/* Useful test for the G4 PowerPC */
fesetround(FE_TOWARDZERO);
- x = get_max ();
+ x = y = get_max ();
x *= 2.0;
- if (x != get_max ())
+ if (x != y)
return 1;
#endif
return 0;
}
-static double get_max (void) { return DBL_MAX; }
+static double get_max (void) { static volatile double d = DBL_MAX; return d; }
], [mpfr_cv_gcc_floatconv_bug="no"],
[mpfr_cv_gcc_floatconv_bug="yes, use -ffloat-store"],
[mpfr_cv_gcc_floatconv_bug="cannot test, use -ffloat-store"])