diff options
author | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-29 20:10:00 +0000 |
---|---|---|
committer | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-29 20:10:00 +0000 |
commit | 0dc2aff5e62a7fa482a89cc410ec63ceefdfeddc (patch) | |
tree | 6368f9b96a1136f25e6faa9fc46751b62fba3c73 /libgfortran | |
parent | 905380a82f5ad715c3d08a6b74ea46c54e1930a5 (diff) | |
download | gcc-0dc2aff5e62a7fa482a89cc410ec63ceefdfeddc.tar.gz |
PR fortran/31832
* acinclude.m4 (LIBGFOR_CHECK_FOR_BROKEN_POWF): New autoconf check for
broken powf.
* configure.ac (LIBGFOR_CHECK_FOR_BROKEN_POWF): Use it.
* intrinsics/c99_functions.c: Use internal powf implementation if
HAVE_BROKEN_POWF is defined.
* configure: Rebuilt.
* config.h.in: Rebuilt.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142952 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 11 | ||||
-rw-r--r-- | libgfortran/acinclude.m4 | 12 | ||||
-rw-r--r-- | libgfortran/config.h.in | 3 | ||||
-rwxr-xr-x | libgfortran/configure | 24 | ||||
-rw-r--r-- | libgfortran/configure.ac | 3 | ||||
-rw-r--r-- | libgfortran/intrinsics/c99_functions.c | 2 |
6 files changed, 55 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index c04331f60fe..aca6e93bfcf 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,14 @@ +2008-12-29 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + PR fortran/31832 + * acinclude.m4 (LIBGFOR_CHECK_FOR_BROKEN_POWF): New autoconf check for + broken powf. + * configure.ac (LIBGFOR_CHECK_FOR_BROKEN_POWF): Use it. + * intrinsics/c99_functions.c: Use internal powf implementation if + HAVE_BROKEN_POWF is defined. + * configure: Rebuilt. + * config.h.in: Rebuilt. + 2008-12-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/37472 diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index 9f8ae54fab6..33552871001 100644 --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -376,3 +376,15 @@ __mingw_snprintf (NULL, 0, "%d\n", 1); AC_DEFINE(HAVE_MINGW_SNPRINTF, 1, [Define if you have __mingw_snprintf.]) fi ]) + +dnl Check whether we have a broken powf implementation +AC_DEFUN([LIBGFOR_CHECK_FOR_BROKEN_POWF], [ + AC_CACHE_CHECK([whether powf is broken], libgfor_cv_have_broken_powf, [ +case "${target}" in + hppa*64*-*-hpux*) libgfor_cv_have_broken_powf=yes ;; + *) libgfor_cv_have_broken_powf=no;; +esac]) + if test x"$libgfor_cv_have_broken_powf" = xyes; then + AC_DEFINE(HAVE_BROKEN_POWF, 1, [Define if powf is broken.]) + fi +]) diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in index 1f291a48e27..3542638b0cd 100644 --- a/libgfortran/config.h.in +++ b/libgfortran/config.h.in @@ -96,6 +96,9 @@ /* Define if isnan is broken. */ #undef HAVE_BROKEN_ISNAN +/* Define if powf is broken. */ +#undef HAVE_BROKEN_POWF + /* libm includes cabs */ #undef HAVE_CABS diff --git a/libgfortran/configure b/libgfortran/configure index 14dda457f20..2d12f9661af 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -33243,6 +33243,30 @@ _ACEOF fi +# Check for a broken powf implementation + + echo "$as_me:$LINENO: checking whether powf is broken" >&5 +echo $ECHO_N "checking whether powf is broken... $ECHO_C" >&6 +if test "${libgfor_cv_have_broken_powf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +case "${target}" in + hppa*64*-*-hpux*) libgfor_cv_have_broken_powf=yes ;; + *) libgfor_cv_have_broken_powf=no;; +esac +fi +echo "$as_me:$LINENO: result: $libgfor_cv_have_broken_powf" >&5 +echo "${ECHO_T}$libgfor_cv_have_broken_powf" >&6 + if test x"$libgfor_cv_have_broken_powf" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_BROKEN_POWF 1 +_ACEOF + + fi + + # Check for GNU libc feenableexcept echo "$as_me:$LINENO: checking for feenableexcept in -lm" >&5 echo $ECHO_N "checking for feenableexcept in -lm... $ECHO_C" >&6 diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index 47d453aaf57..0e0b5a7e31f 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -405,6 +405,9 @@ LIBGFOR_CHECK_WORKING_STAT # Check whether __mingw_snprintf() is present LIBGFOR_CHECK_MINGW_SNPRINTF +# Check for a broken powf implementation +LIBGFOR_CHECK_FOR_BROKEN_POWF + # Check for GNU libc feenableexcept AC_CHECK_LIB([m],[feenableexcept],[have_feenableexcept=yes AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],[libm includes feenableexcept])]) diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c index 13d55036ac9..ce96c8cb54b 100644 --- a/libgfortran/intrinsics/c99_functions.c +++ b/libgfortran/intrinsics/c99_functions.c @@ -491,8 +491,10 @@ nextafterf(float x, float y) #endif +#if !defined(HAVE_POWF) || defined(HAVE_BROKEN_POWF) #ifndef HAVE_POWF #define HAVE_POWF 1 +#endif float powf(float x, float y) { |