From 32101f99491da036f466cd6ba1eed7a2586983af Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Sat, 24 May 2008 05:56:00 +0000 Subject: [PATCH] builtins.c (fold_builtin_fpclassify): Fix spelling of FP_INFINITE. * builtins.c (fold_builtin_fpclassify): Fix spelling of FP_INFINITE. * doc/extend.texi: Likewise. testsuite: * gcc.dg/tg-tests.h: Fix spelling of FP_INFINITE. From-SVN: r135844 --- gcc/ChangeLog | 5 +++++ gcc/builtins.c | 11 ++++++----- gcc/doc/extend.texi | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/tg-tests.h | 8 ++++---- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 57bb8bec414..2a77cf8a207 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-05-24 Kaveh R. Ghazi + + * builtins.c (fold_builtin_fpclassify): Fix spelling of FP_INFINITE. + * doc/extend.texi: Likewise. + 2008-05-23 DJ Delorie * config/m32c/jump.md (untyped_call): Add. diff --git a/gcc/builtins.c b/gcc/builtins.c index d442469b7ee..695567cfbfc 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -9748,14 +9748,15 @@ fold_builtin_classify (tree fndecl, tree arg, int builtin_index) This builtin will generate code to return the appropriate floating point classification depending on the value of the floating point number passed in. The possible return values must be supplied as - int arguments to the call in the following order: FP_NAN, FP_INF, + int arguments to the call in the following order: FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL and FP_ZERO. The ellipses is for exactly one floating point argument which is "type generic". */ static tree fold_builtin_fpclassify (tree exp) { - tree fp_nan, fp_inf, fp_normal, fp_subnormal, fp_zero, arg, type, res, tmp; + tree fp_nan, fp_infinite, fp_normal, fp_subnormal, fp_zero, + arg, type, res, tmp; enum machine_mode mode; REAL_VALUE_TYPE r; char buf[128]; @@ -9767,7 +9768,7 @@ fold_builtin_fpclassify (tree exp) return NULL_TREE; fp_nan = CALL_EXPR_ARG (exp, 0); - fp_inf = CALL_EXPR_ARG (exp, 1); + fp_infinite = CALL_EXPR_ARG (exp, 1); fp_normal = CALL_EXPR_ARG (exp, 2); fp_subnormal = CALL_EXPR_ARG (exp, 3); fp_zero = CALL_EXPR_ARG (exp, 4); @@ -9778,7 +9779,7 @@ fold_builtin_fpclassify (tree exp) /* fpclassify(x) -> isnan(x) ? FP_NAN : - (fabs(x) == Inf ? FP_INF : + (fabs(x) == Inf ? FP_INFINITE : (fabs(x) >= DBL_MIN ? FP_NORMAL : (x == 0 ? FP_ZERO : FP_SUBNORMAL))). */ @@ -9796,7 +9797,7 @@ fold_builtin_fpclassify (tree exp) real_inf (&r); tmp = fold_build2 (EQ_EXPR, integer_type_node, arg, build_real (type, r)); - res = fold_build3 (COND_EXPR, integer_type_node, tmp, fp_inf, res); + res = fold_build3 (COND_EXPR, integer_type_node, tmp, fp_infinite, res); } if (HONOR_NANS (mode)) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index f0e85933699..103af2c4c51 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -6567,7 +6567,7 @@ This built-in implements the C99 fpclassify functionality. The first five int arguments should be the target library's notion of the possible FP classes and are used for return values. They must be constant values and they must appear in this order: @code{FP_NAN}, -@code{FP_INF}, @code{FP_NORMAL}, @code{FP_SUBNORMAL} and +@code{FP_INFINITE}, @code{FP_NORMAL}, @code{FP_SUBNORMAL} and @code{FP_ZERO}. The ellipsis is for exactly one floating point value to classify. GCC treats the last argument as type-generic, which means it does not do default promotion from float to double. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a3edd51d14d..951fe3d5c8a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-05-24 Kaveh R. Ghazi + + * gcc.dg/tg-tests.h: Fix spelling of FP_INFINITE. + 2008-05-23 Sandra Loosemore Daniel Jacobowitz diff --git a/gcc/testsuite/gcc.dg/tg-tests.h b/gcc/testsuite/gcc.dg/tg-tests.h index dc95a2cde62..ce9cfb866cf 100644 --- a/gcc/testsuite/gcc.dg/tg-tests.h +++ b/gcc/testsuite/gcc.dg/tg-tests.h @@ -1,11 +1,11 @@ /* Test various type-generic builtins by calling "main_tests()". */ #define FP_NAN 1 -#define FP_INF 2 +#define FP_INFINITE 2 #define FP_NORMAL 3 #define FP_SUBNORMAL 4 #define FP_ZERO 5 -#define fpclassify(X) __builtin_fpclassify(FP_NAN, FP_INF, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, (X)) +#define fpclassify(X) __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, (X)) void __attribute__ ((__noinline__)) foo_1 (float f, double d, long double ld, @@ -118,7 +118,7 @@ main_tests (void) /* Test infinity. */ f = __builtin_inff(); d = __builtin_inf(); ld = __builtin_infl(); - foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 1, /*isfin=*/ 0, /*isnorm=*/ 0, FP_INF); + foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 1, /*isfin=*/ 0, /*isnorm=*/ 0, FP_INFINITE); /* Test zero. */ f = 0; d = 0; ld = 0; @@ -142,7 +142,7 @@ main_tests (void) /* Test overflow values. */ f = __FLT_MAX__*2; d = __DBL_MAX__*2; ld = __LDBL_MAX__*2; - foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 1, /*isfin=*/ 0, /*isnorm=*/ 0, FP_INF); + foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 1, /*isfin=*/ 0, /*isnorm=*/ 0, FP_INFINITE); return 0; } -- 2.30.2