diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 61e247bde30..bf0fbcdc8d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-02-20 Kaveh R. Ghazi + + * fold-const.c (tree_expr_nonnegative_warnv_p): Handle scalb, + scalbn and scalbln. + 2007-02-20 Geoffrey Keating * config/darwin.h (LINK_SPEC): Default -mmacosx-version-min only diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 951de4098d7..1e623003d18 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -13352,6 +13352,9 @@ tree_expr_nonnegative_warnv_p (tree t, bool *strict_overflow_p) CASE_FLT_FN (BUILT_IN_NEARBYINT): CASE_FLT_FN (BUILT_IN_RINT): CASE_FLT_FN (BUILT_IN_ROUND): + CASE_FLT_FN (BUILT_IN_SCALB): + CASE_FLT_FN (BUILT_IN_SCALBLN): + CASE_FLT_FN (BUILT_IN_SCALBN): CASE_FLT_FN (BUILT_IN_SIGNBIT): CASE_FLT_FN (BUILT_IN_SINH): CASE_FLT_FN (BUILT_IN_TANH): diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d1e67da965f..c62ef00734e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-02-20 Kaveh R. Ghazi + + * gcc.dg/torture/builtin-nonneg-1.c: Add checks for scalb, scalbn + and scalbln. + 2007-02-20 Geoffrey Keating * gcc.dg/darwin-minversion-1.c: New. diff --git a/gcc/testsuite/gcc.dg/torture/builtin-nonneg-1.c b/gcc/testsuite/gcc.dg/torture/builtin-nonneg-1.c index 80cf3e3c83b..1047881333b 100644 --- a/gcc/testsuite/gcc.dg/torture/builtin-nonneg-1.c +++ b/gcc/testsuite/gcc.dg/torture/builtin-nonneg-1.c @@ -120,9 +120,9 @@ void test(double d1, double d2, float f1, float f2, || signbitl(FN##l(fabsl(ld1),fabsl(ld2)))) \ link_failure_##FN() - /* These are nonnegative if the first argument is, 2nd arg is int. */ -#define ARG2TEST1_A2INT(FN) \ - extern void link_failure_##FN (void); PROTOTYPE2TYPE2(FN, int) \ + /* These are nonnegative if the first argument is, 2nd arg is an int. */ +#define ARG1TEST2_A2INT(FN, INTTYPE) \ + extern void link_failure_##FN (void); PROTOTYPE2TYPE2(FN, INTTYPE) \ if (signbit(FN(fabs(d1),d2)) || signbitf(FN##f(fabsf(f1),f2)) \ || signbitl(FN##l(fabsl(ld1),ld2))) \ link_failure_##FN() @@ -143,7 +143,7 @@ void test(double d1, double d2, float f1, float f2, ARG1TEST1 (expm1); ARG1TEST1 (floor); ARG1TEST2 (fmod); - ARG2TEST1_A2INT (ldexp); + ARG1TEST2_A2INT (ldexp, int); ARG1TEST1_RTYPE (llrint, long long); ARG1TEST1_RTYPE (llround, long long); ARG1TEST1_RTYPE (lrint, long); @@ -155,6 +155,9 @@ void test(double d1, double d2, float f1, float f2, ARG1TEST2 (pow); ARG1TEST1 (rint); ARG1TEST1 (round); + ARG1TEST2 (scalb); + ARG1TEST2_A2INT (scalbln, long); + ARG1TEST2_A2INT (scalbn, int); ARG1TEST1_RTYPE (signbit, int); ARG1TEST1 (sinh); ARG1TEST1 (tanh);