diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-05-08 00:13:28 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-05-08 00:13:28 +0000 |
commit | 4440123d289396d317915bcaafeb3b7bd2f455bc (patch) | |
tree | debbefd3f630af250306516c253cfbcab4c27489 /acinclude.m4 | |
parent | 4c6d2f7120252bf78816676c279ad96c2da8d550 (diff) | |
download | mpfr-4440123d289396d317915bcaafeb3b7bd2f455bc.tar.gz |
The problem on a G4 PowerPC was a bug in gcc; this is now tested
in configure (float-conversion bug) and -ffloat-store is used if
need be.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1926 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index c63fb1044..6221b528b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -117,16 +117,30 @@ dnl IEEE-754 compatible rounding mode). if test -n "$GCC"; then AC_CACHE_CHECK([for gcc float-conversion bug], mpfr_cv_gcc_floatconv_bug, [ AC_TRY_RUN([ +#include <float.h> +#ifdef MPFR_HAVE_FESETROUND +#include <fenv.h> +#endif int main() { double x = 0.5; int i; for (i = 1; i <= 11; i++) x *= x; - return x == 0; + if (x != 0) + return 1; +#ifdef MPFR_HAVE_FESETROUND + /* Useful test for the G4 PowerPC */ + fesetround(FE_TOWARDZERO); + x = DBL_MAX; + x *= 2.0; + if (x != DBL_MAX) + return 1; +#endif + return 0; } - ], [mpfr_cv_gcc_floatconv_bug="yes, use -ffloat-store"], - [mpfr_cv_gcc_floatconv_bug="no"], + ], [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"]) ]) if test "$mpfr_cv_gcc_floatconv_bug" != "no"; then |