fold-const.c (tree_expr_nonnegative_warnv_p): Handle scalb, scalbn and scalbln.

* fold-const.c (tree_expr_nonnegative_warnv_p): Handle scalb,
	scalbn and scalbln.

testsuite:
	* gcc.dg/torture/builtin-nonneg-1.c: Add checks for scalb, scalbn
	and scalbln.

From-SVN: r122169
This commit is contained in:
Kaveh R. Ghazi 2007-02-20 19:29:48 +00:00 committed by Kaveh Ghazi
parent a024740df4
commit 8df79ac594
4 changed files with 20 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2007-02-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* fold-const.c (tree_expr_nonnegative_warnv_p): Handle scalb,
scalbn and scalbln.
2007-02-20 Geoffrey Keating <geoffk@apple.com>
* config/darwin.h (LINK_SPEC): Default -mmacosx-version-min only

View File

@ -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):

View File

@ -1,3 +1,8 @@
2007-02-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/torture/builtin-nonneg-1.c: Add checks for scalb, scalbn
and scalbln.
2007-02-20 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/darwin-minversion-1.c: New.

View File

@ -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);