builtin-types.def (BT_INT_PTR, [...]): New.

* builtin-types.def (BT_INT_PTR, BT_FLOAT_PTR, BT_DOUBLE_PTR,
	BT_LONGDOUBLE_PTR, BT_FN_FLOAT_FLOAT_FLOATPTR,
	BT_FN_DOUBLE_DOUBLE_DOUBLEPTR,
	BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR,
	BT_FN_FLOAT_FLOAT_INTPTR, BT_FN_DOUBLE_DOUBLE_INTPTR,
	BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR,
	BT_FN_FLOAT_FLOAT_FLOAT_INTPTR, BT_FN_DOUBLE_DOUBLE_DOUBLE_INTPTR,
	BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_INTPTR,
	BT_FN_VOID_FLOAT_FLOATPTR_FLOATPTR,
	BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR,
	BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR): New.
	* builtins.def (BUILT_IN_FREXP, BUILT_IN_FREXPF, BUILT_IN_FREXPL,
	BUILT_IN_MODF, BUILT_IN_MODFF, BUILT_IN_MODFL, BUILT_IN_REMQUO,
	BUILT_IN_REMQUOF, BUILT_IN_REMQUOL, BUILT_IN_SINCOS,
	BUILT_IN_SINCOSF, BUILT_IN_SINCOSL): New.
	* tree.c: Assign new type_nodes.
	* tree.h (tree_index): Add TI_FLOAT_PTR_TYPE, TI_DOUBLE_PTR_TYPE,
	TI_LONG_DOUBLE_PTR_TYPE, TI_INTEGER_PTR_TYPE.
	(float_ptr_type_node, double_ptr_type_node,
	long_double_ptr_type_node, integer_ptr_type_node): New type_nodes.

	* doc/extend.texi: Document new builtins.

testsuite:
	* gcc.dg/builtins-1.c: Add new builtin cases.

From-SVN: r70890
This commit is contained in:
Kaveh R. Ghazi 2003-08-28 22:00:45 +00:00 committed by Kaveh Ghazi
parent 488f17e1fc
commit a2a919aa50
8 changed files with 146 additions and 23 deletions

View file

@ -1,3 +1,28 @@
2003-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtin-types.def (BT_INT_PTR, BT_FLOAT_PTR, BT_DOUBLE_PTR,
BT_LONGDOUBLE_PTR, BT_FN_FLOAT_FLOAT_FLOATPTR,
BT_FN_DOUBLE_DOUBLE_DOUBLEPTR,
BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR,
BT_FN_FLOAT_FLOAT_INTPTR, BT_FN_DOUBLE_DOUBLE_INTPTR,
BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR,
BT_FN_FLOAT_FLOAT_FLOAT_INTPTR, BT_FN_DOUBLE_DOUBLE_DOUBLE_INTPTR,
BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_INTPTR,
BT_FN_VOID_FLOAT_FLOATPTR_FLOATPTR,
BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR,
BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR): New.
* builtins.def (BUILT_IN_FREXP, BUILT_IN_FREXPF, BUILT_IN_FREXPL,
BUILT_IN_MODF, BUILT_IN_MODFF, BUILT_IN_MODFL, BUILT_IN_REMQUO,
BUILT_IN_REMQUOF, BUILT_IN_REMQUOL, BUILT_IN_SINCOS,
BUILT_IN_SINCOSF, BUILT_IN_SINCOSL): New.
* tree.c: Assign new type_nodes.
* tree.h (tree_index): Add TI_FLOAT_PTR_TYPE, TI_DOUBLE_PTR_TYPE,
TI_LONG_DOUBLE_PTR_TYPE, TI_INTEGER_PTR_TYPE.
(float_ptr_type_node, double_ptr_type_node,
long_double_ptr_type_node, integer_ptr_type_node): New type_nodes.
* doc/extend.texi: Document new builtins.
2003-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2003-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtin-types.def (BT_FN_FLOAT_INT_FLOAT, * builtin-types.def (BT_FN_FLOAT_INT_FLOAT,

View file

@ -75,6 +75,10 @@ DEF_PRIMITIVE_TYPE (BT_COMPLEX_LONGDOUBLE, complex_long_double_type_node)
DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node) DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node) DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0)) DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0))
DEF_PRIMITIVE_TYPE (BT_INT_PTR, integer_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_FLOAT_PTR, float_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_DOUBLE_PTR, double_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_LONGDOUBLE_PTR, long_double_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_SIZE, size_type_node) DEF_PRIMITIVE_TYPE (BT_SIZE, size_type_node)
DEF_PRIMITIVE_TYPE (BT_SSIZE, signed_size_type_node) DEF_PRIMITIVE_TYPE (BT_SSIZE, signed_size_type_node)
DEF_PRIMITIVE_TYPE (BT_STRING, string_type_node) DEF_PRIMITIVE_TYPE (BT_STRING, string_type_node)
@ -170,6 +174,12 @@ DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_DOUBLE,
BT_DOUBLE, BT_DOUBLE, BT_DOUBLE) BT_DOUBLE, BT_DOUBLE, BT_DOUBLE)
DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE,
BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE) BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE)
DEF_FUNCTION_TYPE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UBLEPTR_DOUBLEPTR,
BT_VOID, BT_DOUBLE, BT_DOUBLE_PTR, BT_DOUBLE_PTR)
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR,
BT_VOID, BT_LONGDOUBLE, BT_LONGDOUBLE_PTR, BT_LONGDOUBLE_PTR)
DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR, DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_PTR) BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_PTR)

View file

@ -221,6 +221,9 @@ DEF_C99_BUILTIN (BUILT_IN_FMINL, "fminl", BT_FN_LONGDOUBLE_LONGDOUBLE_LON
DEF_LIB_BUILTIN (BUILT_IN_FMOD, "fmod", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_LIB_BUILTIN (BUILT_IN_FMOD, "fmod", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_C90RES_BUILTIN (BUILT_IN_FMODF, "fmodf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_C90RES_BUILTIN (BUILT_IN_FMODF, "fmodf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_C90RES_BUILTIN (BUILT_IN_FMODL, "fmodl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_C90RES_BUILTIN (BUILT_IN_FMODL, "fmodl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_LIB_BUILTIN (BUILT_IN_FREXP, "frexp", BT_FN_DOUBLE_DOUBLE_INTPTR, ATTR_NOTHROW_LIST)
DEF_C99_C90RES_BUILTIN (BUILT_IN_FREXPF, "frexpf", BT_FN_FLOAT_FLOAT_INTPTR, ATTR_NOTHROW_LIST)
DEF_C99_C90RES_BUILTIN (BUILT_IN_FREXPL, "frexpl", BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR, ATTR_NOTHROW_LIST)
DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMA, "gamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMA, "gamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAF, "gammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAF, "gammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAL, "gammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAL, "gammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
@ -278,6 +281,9 @@ DEF_C99_BUILTIN (BUILT_IN_LRINTL, "lrintl", BT_FN_LONG_LONGDOUBLE, ATTR_M
DEF_C99_BUILTIN (BUILT_IN_LROUND, "lround", BT_FN_LONG_DOUBLE, ATTR_MATHFN_ERRNO) DEF_C99_BUILTIN (BUILT_IN_LROUND, "lround", BT_FN_LONG_DOUBLE, ATTR_MATHFN_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_LROUNDF, "lroundf", BT_FN_LONG_FLOAT, ATTR_MATHFN_ERRNO) DEF_C99_BUILTIN (BUILT_IN_LROUNDF, "lroundf", BT_FN_LONG_FLOAT, ATTR_MATHFN_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_LROUNDL, "lroundl", BT_FN_LONG_LONGDOUBLE, ATTR_MATHFN_ERRNO) DEF_C99_BUILTIN (BUILT_IN_LROUNDL, "lroundl", BT_FN_LONG_LONGDOUBLE, ATTR_MATHFN_ERRNO)
DEF_LIB_BUILTIN (BUILT_IN_MODF, "modf", BT_FN_DOUBLE_DOUBLE_DOUBLEPTR, ATTR_NOTHROW_LIST)
DEF_C99_C90RES_BUILTIN (BUILT_IN_MODFF, "modff", BT_FN_FLOAT_FLOAT_FLOATPTR, ATTR_NOTHROW_LIST)
DEF_C99_C90RES_BUILTIN (BUILT_IN_MODFL, "modfl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR, ATTR_NOTHROW_LIST)
DEF_LIB_BUILTIN (BUILT_IN_NAN, "nan", BT_FN_DOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1) DEF_LIB_BUILTIN (BUILT_IN_NAN, "nan", BT_FN_DOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1)
DEF_LIB_BUILTIN (BUILT_IN_NANF, "nanf", BT_FN_FLOAT_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1) DEF_LIB_BUILTIN (BUILT_IN_NANF, "nanf", BT_FN_FLOAT_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1)
DEF_LIB_BUILTIN (BUILT_IN_NANL, "nanl", BT_FN_LONGDOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1) DEF_LIB_BUILTIN (BUILT_IN_NANL, "nanl", BT_FN_LONGDOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1)
@ -302,6 +308,9 @@ DEF_C99_C90RES_BUILTIN (BUILT_IN_POWL, "powl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGD
DEF_C99_BUILTIN (BUILT_IN_REMAINDER, "remainder", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_REMAINDER, "remainder", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_REMAINDERF, "remainderf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_REMAINDERF, "remainderf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_REMAINDERL, "remainderl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_REMAINDERL, "remainderl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_REMQUO, "remquo", BT_FN_DOUBLE_DOUBLE_DOUBLE_INTPTR, ATTR_NOTHROW_LIST)
DEF_C99_BUILTIN (BUILT_IN_REMQUOF, "remquof", BT_FN_FLOAT_FLOAT_FLOAT_INTPTR, ATTR_NOTHROW_LIST)
DEF_C99_BUILTIN (BUILT_IN_REMQUOL, "remquol", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_INTPTR, ATTR_NOTHROW_LIST)
DEF_C99_BUILTIN (BUILT_IN_RINT, "rint", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_RINT, "rint", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_RINTF, "rintf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_RINTF, "rintf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_RINTL, "rintl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_RINTL, "rintl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
@ -321,6 +330,9 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICAND, "significand", BT_FN_DOUBLE_DOUBLE
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICANDF, "significandf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICANDF, "significandf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICANDL, "significandl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICANDL, "significandl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_LIB_BUILTIN (BUILT_IN_SIN, "sin", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING) DEF_LIB_BUILTIN (BUILT_IN_SIN, "sin", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
DEF_EXT_LIB_BUILTIN (BUILT_IN_SINCOS, "sincos", BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR, ATTR_NOTHROW_LIST)
DEF_EXT_LIB_BUILTIN (BUILT_IN_SINCOSF, "sincosf", BT_FN_VOID_FLOAT_FLOATPTR_FLOATPTR, ATTR_NOTHROW_LIST)
DEF_EXT_LIB_BUILTIN (BUILT_IN_SINCOSL, "sincosl", BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR, ATTR_NOTHROW_LIST)
DEF_C99_C90RES_BUILTIN (BUILT_IN_SINF, "sinf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING) DEF_C99_C90RES_BUILTIN (BUILT_IN_SINF, "sinf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
DEF_LIB_BUILTIN (BUILT_IN_SINH, "sinh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_LIB_BUILTIN (BUILT_IN_SINH, "sinh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_C90RES_BUILTIN (BUILT_IN_SINHF, "sinhf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_C90RES_BUILTIN (BUILT_IN_SINHF, "sinhf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)

View file

@ -4831,6 +4831,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex fprintf_unlocked @findex fprintf_unlocked
@findex fputs @findex fputs
@findex fputs_unlocked @findex fputs_unlocked
@findex frexp
@findex frexpf
@findex frexpl
@findex fscanf @findex fscanf
@findex gamma @findex gamma
@findex gammaf @findex gammaf
@ -4893,6 +4896,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex memcpy @findex memcpy
@findex mempcpy @findex mempcpy
@findex memset @findex memset
@findex modf
@findex modff
@findex modfl
@findex nearbyint @findex nearbyint
@findex nearbyintf @findex nearbyintf
@findex nearbyintl @findex nearbyintl
@ -4915,6 +4921,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex remainder @findex remainder
@findex remainderf @findex remainderf
@findex remainderl @findex remainderl
@findex remquo
@findex remquof
@findex remquol
@findex rindex @findex rindex
@findex rint @findex rint
@findex rintf @findex rintf
@ -4935,6 +4944,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex significandf @findex significandf
@findex significandl @findex significandl
@findex sin @findex sin
@findex sincos
@findex sincosf
@findex sincosl
@findex sinf @findex sinf
@findex sinh @findex sinh
@findex sinhf @findex sinhf
@ -5023,9 +5035,9 @@ Outside strict ISO C mode (@option{-ansi}, @option{-std=c89} or
@code{pow10f}, @code{pow10l}, @code{pow10}, @code{printf_unlocked}, @code{pow10f}, @code{pow10l}, @code{pow10}, @code{printf_unlocked},
@code{rindex}, @code{scalbf}, @code{scalbl}, @code{scalb}, @code{rindex}, @code{scalbf}, @code{scalbl}, @code{scalb},
@code{significandf}, @code{significandl}, @code{significand}, @code{significandf}, @code{significandl}, @code{significand},
@code{stpcpy}, @code{strdup}, @code{strfmon}, @code{y0f}, @code{y0l}, @code{sincosf}, @code{sincosl}, @code{sincos}, @code{stpcpy},
@code{y0}, @code{y1f}, @code{y1l}, @code{y1}, @code{ynf}, @code{ynl} and @code{strdup}, @code{strfmon}, @code{y0f}, @code{y0l}, @code{y0},
@code{yn} @code{y1f}, @code{y1l}, @code{y1}, @code{ynf}, @code{ynl} and @code{yn}
may be handled as built-in functions. may be handled as built-in functions.
All these functions have corresponding versions All these functions have corresponding versions
prefixed with @code{__builtin_}, which may be used even in strict C89 prefixed with @code{__builtin_}, which may be used even in strict C89
@ -5053,13 +5065,13 @@ The ISO C99 functions
@code{nearbyintf}, @code{nearbyintl}, @code{nearbyint}, @code{nearbyintf}, @code{nearbyintl}, @code{nearbyint},
@code{nextafterf}, @code{nextafterl}, @code{nextafter}, @code{nextafterf}, @code{nextafterl}, @code{nextafter},
@code{nexttowardf}, @code{nexttowardl}, @code{nexttoward}, @code{nexttowardf}, @code{nexttowardl}, @code{nexttoward},
@code{remainderf}, @code{remainderl}, @code{remainder}, @code{rintf}, @code{remainderf}, @code{remainderl}, @code{remainder}, @code{remquof},
@code{rintl}, @code{rint}, @code{roundf}, @code{roundl}, @code{round}, @code{remquol}, @code{remquo}, @code{rintf}, @code{rintl}, @code{rint},
@code{scalblnf}, @code{scalblnl}, @code{scalbln}, @code{scalbnf}, @code{roundf}, @code{roundl}, @code{round}, @code{scalblnf},
@code{scalbnl}, @code{scalbn}, @code{snprintf}, @code{tgammaf}, @code{scalblnl}, @code{scalbln}, @code{scalbnf}, @code{scalbnl},
@code{tgammal}, @code{tgamma}, @code{truncf}, @code{truncl}, @code{scalbn}, @code{snprintf}, @code{tgammaf}, @code{tgammal},
@code{trunc}, @code{vfscanf}, @code{vscanf}, @code{vsnprintf} and @code{tgamma}, @code{truncf}, @code{truncl}, @code{trunc},
@code{vsscanf}, @code{vfscanf}, @code{vscanf}, @code{vsnprintf} and @code{vsscanf},
are handled as built-in functions are handled as built-in functions
except in strict ISO C90 mode (@option{-ansi} or @option{-std=c89}). except in strict ISO C90 mode (@option{-ansi} or @option{-std=c89}).
@ -5068,10 +5080,11 @@ There are also built-in versions of the ISO C99 functions
@code{atan2l}, @code{atanf}, @code{atanl}, @code{ceilf}, @code{ceill}, @code{atan2l}, @code{atanf}, @code{atanl}, @code{ceilf}, @code{ceill},
@code{cosf}, @code{coshf}, @code{coshl}, @code{cosl}, @code{expf}, @code{cosf}, @code{coshf}, @code{coshl}, @code{cosl}, @code{expf},
@code{expl}, @code{fabsf}, @code{fabsl}, @code{floorf}, @code{floorl}, @code{expl}, @code{fabsf}, @code{fabsl}, @code{floorf}, @code{floorl},
@code{fmodf}, @code{fmodl}, @code{ldexpf}, @code{ldexpl}, @code{log10f}, @code{fmodf}, @code{fmodl}, @code{frexpf}, @code{frexpl}, @code{ldexpf},
@code{log10l}, @code{logf}, @code{logl}, @code{powf}, @code{powl}, @code{ldexpl}, @code{log10f}, @code{log10l}, @code{logf}, @code{logl},
@code{sinf}, @code{sinhf}, @code{sinhl}, @code{sinl}, @code{sqrtf}, @code{modfl}, @code{modf}, @code{powf}, @code{powl}, @code{sinf},
@code{sqrtl}, @code{tanf}, @code{tanhf}, @code{tanhl} and @code{tanl} @code{sinhf}, @code{sinhl}, @code{sinl}, @code{sqrtf}, @code{sqrtl},
@code{tanf}, @code{tanhf}, @code{tanhl} and @code{tanl}
that are recognized in any mode since ISO C90 reserves these names for that are recognized in any mode since ISO C90 reserves these names for
the purpose to which ISO C99 puts them. All these functions have the purpose to which ISO C99 puts them. All these functions have
corresponding versions prefixed with @code{__builtin_}. corresponding versions prefixed with @code{__builtin_}.
@ -5080,15 +5093,16 @@ The ISO C90 functions
@code{abort}, @code{abs}, @code{acos}, @code{asin}, @code{atan2}, @code{abort}, @code{abs}, @code{acos}, @code{asin}, @code{atan2},
@code{atan}, @code{calloc}, @code{ceil}, @code{cosh}, @code{cos}, @code{atan}, @code{calloc}, @code{ceil}, @code{cosh}, @code{cos},
@code{exit}, @code{exp}, @code{fabs}, @code{floor}, @code{fmod}, @code{exit}, @code{exp}, @code{fabs}, @code{floor}, @code{fmod},
@code{fprintf}, @code{fputs}, @code{fscanf}, @code{labs}, @code{ldexp}, @code{fprintf}, @code{fputs}, @code{frexp}, @code{fscanf}, @code{labs},
@code{log10}, @code{log}, @code{malloc}, @code{memcmp}, @code{memcpy}, @code{ldexp}, @code{log10}, @code{log}, @code{malloc}, @code{memcmp},
@code{memset}, @code{pow}, @code{printf}, @code{putchar}, @code{puts}, @code{memcpy}, @code{memset}, @code{modf}, @code{pow}, @code{printf},
@code{scanf}, @code{sinh}, @code{sin}, @code{snprintf}, @code{sprintf}, @code{putchar}, @code{puts}, @code{scanf}, @code{sinh}, @code{sin},
@code{sqrt}, @code{sscanf}, @code{strcat}, @code{strchr}, @code{strcmp}, @code{snprintf}, @code{sprintf}, @code{sqrt}, @code{sscanf},
@code{strcpy}, @code{strcspn}, @code{strlen}, @code{strncat}, @code{strcat}, @code{strchr}, @code{strcmp}, @code{strcpy},
@code{strncmp}, @code{strncpy}, @code{strpbrk}, @code{strrchr}, @code{strcspn}, @code{strlen}, @code{strncat}, @code{strncmp},
@code{strspn}, @code{strstr}, @code{tanh}, @code{tan}, @code{vfprintf}, @code{strncpy}, @code{strpbrk}, @code{strrchr}, @code{strspn},
@code{vprintf} and @code{vsprintf}, @code{strstr}, @code{tanh}, @code{tan}, @code{vfprintf}, @code{vprintf}
and @code{vsprintf}
are all recognized as built-in functions unless are all recognized as built-in functions unless
@option{-fno-builtin} is specified (or @option{-fno-builtin-@var{function}} @option{-fno-builtin} is specified (or @option{-fno-builtin-@var{function}}
is specified for an individual function). All of these functions have is specified for an individual function). All of these functions have

View file

@ -1,3 +1,7 @@
2003-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/builtins-1.c: Add new builtin cases.
2003-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2003-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/builtins-1.c: Add new cases. * gcc.dg/builtins-1.c: Add new cases.

View file

@ -44,6 +44,13 @@ double test_##FN(double x, TYPE y) { return __builtin_##FN(x, y); } \
float test_##FN##f(float x, TYPE y) { return __builtin_##FN##f(x, y); } \ float test_##FN##f(float x, TYPE y) { return __builtin_##FN##f(x, y); } \
long double test_##FN##l(long double x, TYPE y) { return __builtin_##FN##l(x, y); } long double test_##FN##l(long double x, TYPE y) { return __builtin_##FN##l(x, y); }
/* Test FP functions taking two arguments, the second argument is a
FP pointer. */
#define FPTEST2FPP2(FN) \
double test_##FN(double x, double *y) { return __builtin_##FN(x, y); } \
float test_##FN##f(float x, float *y) { return __builtin_##FN##f(x, y); } \
long double test_##FN##l(long double x, long double *y) { return __builtin_##FN##l(x, y); }
/* Test FP functions taking one FP argument and a supplied return /* Test FP functions taking one FP argument and a supplied return
type. */ type. */
#define FPTEST1RET(FN, TYPE) \ #define FPTEST1RET(FN, TYPE) \
@ -63,6 +70,20 @@ double test_##FN(double x, double y, double z) { return __builtin_##FN(x, y, z);
float test_##FN##f(float x, float y, float z) { return __builtin_##FN##f(x, y, z); } \ float test_##FN##f(float x, float y, float z) { return __builtin_##FN##f(x, y, z); } \
long double test_##FN##l(long double x, long double y, long double z) { return __builtin_##FN##l(x, y, z); } long double test_##FN##l(long double x, long double y, long double z) { return __builtin_##FN##l(x, y, z); }
/* Test FP functions taking three arguments, two FP and the third is
of a supplied type. */
#define FPTEST3ARG3(FN, TYPE) \
double test_##FN(double x, double y, TYPE z) { return __builtin_##FN(x, y, z); } \
float test_##FN##f(float x, float y, TYPE z) { return __builtin_##FN##f(x, y, z); } \
long double test_##FN##l(long double x, long double y, TYPE z) { return __builtin_##FN##l(x, y, z); }
/* Test FP functions taking three FP arguments. The second and third
are FP pointers. The return type is void. */
#define FPTEST3FPP23VOID(FN) \
double test_##FN(double x, double *y, double *z) { __builtin_##FN(x, y, z); return *y * *z; } \
float test_##FN##f(float x, float *y, float *z) { __builtin_##FN##f(x, y, z); return *y * *z; } \
long double test_##FN##l(long double x, long double *y, long double *z) { __builtin_##FN##l(x, y, z); return *y * *z; }
/* Keep this list sorted alphabetically by function name. */ /* Keep this list sorted alphabetically by function name. */
FPTEST1 (acos) FPTEST1 (acos)
FPTEST1 (acosh) FPTEST1 (acosh)
@ -90,6 +111,7 @@ FPTEST3 (fma)
FPTEST2 (fmax) FPTEST2 (fmax)
FPTEST2 (fmin) FPTEST2 (fmin)
FPTEST2 (fmod) FPTEST2 (fmod)
FPTEST2ARG2 (frexp, int *)
FPTEST1 (gamma) FPTEST1 (gamma)
FPTEST0 (huge_val) FPTEST0 (huge_val)
FPTEST2 (hypot) FPTEST2 (hypot)
@ -109,6 +131,7 @@ FPTEST1 (log2)
FPTEST1 (logb) FPTEST1 (logb)
FPTEST1RET (lrint, long) FPTEST1RET (lrint, long)
FPTEST1RET (lround, long) FPTEST1RET (lround, long)
FPTEST2FPP2 (modf)
FPTEST1ARG (nan, char *) FPTEST1ARG (nan, char *)
FPTEST1ARG (nans, char *) FPTEST1ARG (nans, char *)
FPTEST1 (nearbyint) FPTEST1 (nearbyint)
@ -117,6 +140,7 @@ FPTEST2 (nexttoward)
FPTEST2 (pow) FPTEST2 (pow)
FPTEST1 (pow10) FPTEST1 (pow10)
FPTEST2 (remainder) FPTEST2 (remainder)
FPTEST3ARG3 (remquo, int *)
FPTEST1 (rint) FPTEST1 (rint)
FPTEST1 (round) FPTEST1 (round)
FPTEST2 (scalb) FPTEST2 (scalb)
@ -124,6 +148,7 @@ FPTEST2ARG2 (scalbln, int)
FPTEST2ARG2 (scalbn, int) FPTEST2ARG2 (scalbn, int)
FPTEST1 (significand) FPTEST1 (significand)
FPTEST1 (sin) FPTEST1 (sin)
FPTEST3FPP23VOID (sincos)
FPTEST1 (sinh) FPTEST1 (sinh)
FPTEST1 (sqrt) FPTEST1 (sqrt)
FPTEST1 (tan) FPTEST1 (tan)

View file

@ -4858,6 +4858,11 @@ build_common_tree_nodes_2 (int short_double)
TYPE_PRECISION (long_double_type_node) = LONG_DOUBLE_TYPE_SIZE; TYPE_PRECISION (long_double_type_node) = LONG_DOUBLE_TYPE_SIZE;
layout_type (long_double_type_node); layout_type (long_double_type_node);
float_ptr_type_node = build_pointer_type (float_type_node);
double_ptr_type_node = build_pointer_type (double_type_node);
long_double_ptr_type_node = build_pointer_type (long_double_type_node);
integer_ptr_type_node = build_pointer_type (integer_type_node);
complex_integer_type_node = make_node (COMPLEX_TYPE); complex_integer_type_node = make_node (COMPLEX_TYPE);
TREE_TYPE (complex_integer_type_node) = integer_type_node; TREE_TYPE (complex_integer_type_node) = integer_type_node;
layout_type (complex_integer_type_node); layout_type (complex_integer_type_node);

View file

@ -1809,6 +1809,11 @@ enum tree_index
TI_DOUBLE_TYPE, TI_DOUBLE_TYPE,
TI_LONG_DOUBLE_TYPE, TI_LONG_DOUBLE_TYPE,
TI_FLOAT_PTR_TYPE,
TI_DOUBLE_PTR_TYPE,
TI_LONG_DOUBLE_PTR_TYPE,
TI_INTEGER_PTR_TYPE,
TI_VOID_TYPE, TI_VOID_TYPE,
TI_PTR_TYPE, TI_PTR_TYPE,
TI_CONST_PTR_TYPE, TI_CONST_PTR_TYPE,
@ -1887,6 +1892,11 @@ extern GTY(()) tree global_trees[TI_MAX];
#define double_type_node global_trees[TI_DOUBLE_TYPE] #define double_type_node global_trees[TI_DOUBLE_TYPE]
#define long_double_type_node global_trees[TI_LONG_DOUBLE_TYPE] #define long_double_type_node global_trees[TI_LONG_DOUBLE_TYPE]
#define float_ptr_type_node global_trees[TI_FLOAT_PTR_TYPE]
#define double_ptr_type_node global_trees[TI_DOUBLE_PTR_TYPE]
#define long_double_ptr_type_node global_trees[TI_LONG_DOUBLE_PTR_TYPE]
#define integer_ptr_type_node global_trees[TI_INTEGER_PTR_TYPE]
#define complex_integer_type_node global_trees[TI_COMPLEX_INTEGER_TYPE] #define complex_integer_type_node global_trees[TI_COMPLEX_INTEGER_TYPE]
#define complex_float_type_node global_trees[TI_COMPLEX_FLOAT_TYPE] #define complex_float_type_node global_trees[TI_COMPLEX_FLOAT_TYPE]
#define complex_double_type_node global_trees[TI_COMPLEX_DOUBLE_TYPE] #define complex_double_type_node global_trees[TI_COMPLEX_DOUBLE_TYPE]