summaryrefslogtreecommitdiff
path: root/libgfortran/intrinsics/c99_functions.c
diff options
context:
space:
mode:
authorsje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-27 21:12:52 +0000
committersje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-27 21:12:52 +0000
commit839904a0e3a1859cdfeb5ff23e5263c332f347fa (patch)
treeb153488273b3833bfdf44f1f0c3ac72e033b31c2 /libgfortran/intrinsics/c99_functions.c
parentc0edfcc4dff63bcbbfdb726a7e1f36fd42c53c3c (diff)
downloadgcc-839904a0e3a1859cdfeb5ff23e5263c332f347fa.tar.gz
PR target/23552
* acinclude.m4 (LIBGFOR_CHECK_FOR_BROKEN_ISFINITE): New. (LIBGFOR_CHECK_FOR_BROKEN_ISNAN): New. (LIBGFOR_CHECK_FOR_BROKEN_FPCLASSIFY): New. * configure.ac (LIBGFOR_CHECK_FOR_BROKEN_ISFINITE): Add use. (LIBGFOR_CHECK_FOR_BROKEN_ISNAN): Add use. (LIBGFOR_CHECK_FOR_BROKEN_FPCLASSIFY): Add use. * configure: Regenerate. * config.h.in: Regenerate. * libgfortan.h (isfinite): undef if broken, set if needed. (isnan): undef if broken, set if needed. (fpclassify): undef if broken, set if needed. * io/write.c: Remove TODO comment about working isfinite. * intrinsics/c99_functions.c (round): Use isfinite instead of fpclassify. * intrinsics/c99_functions.c (roundf): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104710 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/intrinsics/c99_functions.c')
-rw-r--r--libgfortran/intrinsics/c99_functions.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c
index 8083f776df5..2417e69cbed 100644
--- a/libgfortran/intrinsics/c99_functions.c
+++ b/libgfortran/intrinsics/c99_functions.c
@@ -344,12 +344,8 @@ double
round(double x)
{
double t;
-#if defined(fpclassify)
- int i;
- i = fpclassify(x);
- if (i == FP_INFINITE || i == FP_NAN)
+ if (!isfinite (x))
return (x);
-#endif
if (x >= 0.0)
{
@@ -377,13 +373,8 @@ float
roundf(float x)
{
float t;
-#if defined(fpclassify)
- int i;
-
- i = fpclassify(x);
- if (i == FP_INFINITE || i == FP_NAN)
+ if (!isfinite (x))
return (x);
-#endif
if (x >= 0.0)
{