aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-02-26 03:02:14 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-02-26 03:02:14 +0000
commitb052d8ee4d954827cac504052ede36053543a2a4 (patch)
tree62a6d7eda515c0ef561243d4759cd9642e58e72f /gcc
parent8d4540089a757d0f1860f2169937c95c77b6388b (diff)
downloadgcc-b052d8ee4d954827cac504052ede36053543a2a4.zip
gcc-b052d8ee4d954827cac504052ede36053543a2a4.tar.gz
gcc-b052d8ee4d954827cac504052ede36053543a2a4.tar.bz2
builtins.def (DEF_LIB_ALWAYS_BUILTIN, [...]): Delete.
* builtins.def (DEF_LIB_ALWAYS_BUILTIN, DEF_UNUSED_BUILTIN): Delete. (abs, labs, fabs, fabsf, fabsl, abort, exit, _exit, _Exit): Use the appropriate macro to define built-in function. (fmod,fmodf,fmodl): New built-in functions. * java/decl.c (java_init_decl_processing): Get soft_fmod_node from built_in_decls[BUILT_IN_FMOD] rather than define it ourselves. * doc/extend.texi (fmod,fmodf,fmodl): Document new built-ins. From-SVN: r63445
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/builtins.def127
-rw-r--r--gcc/doc/extend.texi59
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/decl.c23
5 files changed, 106 insertions, 117 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 80f2afa..8d0407b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2003-02-25 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.def (DEF_LIB_ALWAYS_BUILTIN, DEF_UNUSED_BUILTIN): Delete.
+ (abs, labs, fabs, fabsf, fabsl, abort, exit, _exit, _Exit): Use
+ the appropriate macro to define built-in function.
+ (fmod,fmodf,fmodl): New built-in functions.
+
+ * doc/extend.texi (fmod,fmodf,fmodl): Document new built-ins.
+
2003-02-25 Richard Henderson <rth@redhat.com>
* config/i386/i386.c (function_arg): Pass variable sized
diff --git a/gcc/builtins.def b/gcc/builtins.def
index 268696e..ae7d640 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -99,13 +99,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
true, true, false, ATTRS, true)
-/* Like DEF_LIB_BUILTIN, except that a call to the builtin should
- never fall back to the library version. */
-#undef DEF_LIB_ALWAYS_BUILTIN
-#define DEF_LIB_ALWAYS_BUILTIN(ENUM, NAME, TYPE) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
- true, false, true, ATTR_CONST_NOTHROW_LIST, true)
-
/* Like DEF_LIB_BUILTIN, except that the function is not one that is
specified by ANSI/ISO C. So, when we're being fully conformant we
ignore the version of these builtins that does not begin with
@@ -146,12 +139,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE, \
true, true, true, ATTRS, true)
-/* A built-in that is not currently used. */
-#undef DEF_UNUSED_BUILTIN
-#define DEF_UNUSED_BUILTIN(X) \
- DEF_BUILTIN (X, (const char *) NULL, NOT_BUILT_IN, BT_LAST, \
- BT_LAST, false, false, false, ATTR_NOTHROW_LIST, false)
-
/* If SMALL_STACK is defined, then `alloca' is only defined in its
`__builtin' form. */
#if SMALL_STACK
@@ -166,22 +153,27 @@ DEF_EXT_LIB_BUILTIN(BUILT_IN_ALLOCA,
ATTR_MALLOC_NOTHROW_LIST)
#endif
-DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_ABS,
- "__builtin_abs",
- BT_FN_INT_INT)
-DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_LABS,
- "__builtin_labs",
- BT_FN_LONG_LONG)
-
-DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABS,
- "__builtin_fabs",
- BT_FN_DOUBLE_DOUBLE)
-DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSF,
+DEF_LIB_BUILTIN(BUILT_IN_ABS,
+ "__builtin_abs",
+ BT_FN_INT_INT,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_LIB_BUILTIN(BUILT_IN_LABS,
+ "__builtin_labs",
+ BT_FN_LONG_LONG,
+ ATTR_CONST_NOTHROW_LIST)
+
+DEF_LIB_BUILTIN(BUILT_IN_FABS,
+ "__builtin_fabs",
+ BT_FN_DOUBLE_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_C99_C90RES_BUILTIN(BUILT_IN_FABSF,
"__builtin_fabsf",
- BT_FN_FLOAT_FLOAT)
-DEF_LIB_ALWAYS_BUILTIN(BUILT_IN_FABSL,
+ BT_FN_FLOAT_FLOAT,
+ ATTR_CONST_NOTHROW_LIST)
+DEF_C99_C90RES_BUILTIN(BUILT_IN_FABSL,
"__builtin_fabsl",
- BT_FN_LONG_DOUBLE_LONG_DOUBLE)
+ BT_FN_LONG_DOUBLE_LONG_DOUBLE,
+ ATTR_CONST_NOTHROW_LIST)
DEF_LIB_BUILTIN(BUILT_IN_FLOOR,
"__builtin_floor",
@@ -293,13 +285,6 @@ DEF_C99_BUILTIN(BUILT_IN_CIMAGL,
BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
ATTR_CONST_NOTHROW_LIST)
-DEF_UNUSED_BUILTIN(BUILT_IN_DIV)
-DEF_UNUSED_BUILTIN(BUILT_IN_LDIV)
-DEF_UNUSED_BUILTIN(BUILT_IN_FFLOOR)
-DEF_UNUSED_BUILTIN(BUILT_IN_FCEIL)
-DEF_UNUSED_BUILTIN(BUILT_IN_FMOD)
-DEF_UNUSED_BUILTIN(BUILT_IN_FREM)
-
/* The system prototypes for `bzero' and `bcmp' functions have many
variations, so don't specify parameters to avoid conflicts. The
expand_* functions check the argument types anyway. */
@@ -501,6 +486,13 @@ DEF_LIB_BUILTIN(BUILT_IN_ATAN2,
: (flag_unsafe_math_optimizations
? ATTR_CONST_NOTHROW_LIST
: ATTR_PURE_NOTHROW_LIST))
+DEF_LIB_BUILTIN(BUILT_IN_FMOD,
+ "__builtin_fmod",
+ BT_FN_DOUBLE_DOUBLE_DOUBLE,
+ flag_errno_math ? ATTR_NOTHROW_LIST
+ : (flag_unsafe_math_optimizations
+ ? ATTR_CONST_NOTHROW_LIST
+ : ATTR_PURE_NOTHROW_LIST))
DEF_C99_C90RES_BUILTIN(BUILT_IN_SQRTF,
"__builtin_sqrtf",
BT_FN_FLOAT_FLOAT,
@@ -546,6 +538,13 @@ DEF_C99_C90RES_BUILTIN(BUILT_IN_ATAN2F,
: (flag_unsafe_math_optimizations
? ATTR_CONST_NOTHROW_LIST
: ATTR_PURE_NOTHROW_LIST))
+DEF_C99_C90RES_BUILTIN(BUILT_IN_FMODF,
+ "__builtin_fmodf",
+ BT_FN_FLOAT_FLOAT_FLOAT,
+ flag_errno_math ? ATTR_NOTHROW_LIST
+ : (flag_unsafe_math_optimizations
+ ? ATTR_CONST_NOTHROW_LIST
+ : ATTR_PURE_NOTHROW_LIST))
DEF_C99_C90RES_BUILTIN(BUILT_IN_SQRTL,
"__builtin_sqrtl",
BT_FN_LONG_DOUBLE_LONG_DOUBLE,
@@ -591,6 +590,13 @@ DEF_C99_C90RES_BUILTIN(BUILT_IN_ATAN2L,
: (flag_unsafe_math_optimizations
? ATTR_CONST_NOTHROW_LIST
: ATTR_PURE_NOTHROW_LIST))
+DEF_C99_C90RES_BUILTIN(BUILT_IN_FMODL,
+ "__builtin_fmodl",
+ BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE,
+ flag_errno_math ? ATTR_NOTHROW_LIST
+ : (flag_unsafe_math_optimizations
+ ? ATTR_CONST_NOTHROW_LIST
+ : ATTR_PURE_NOTHROW_LIST))
DEF_GCC_BUILTIN(BUILT_IN_INF,
"__builtin_inf",
@@ -857,42 +863,21 @@ DEF_GCC_BUILTIN(BUILT_IN_EXPECT,
BT_FN_LONG_LONG_LONG,
ATTR_NULL)
-/* C++ extensions */
-DEF_UNUSED_BUILTIN(BUILT_IN_NEW)
-DEF_UNUSED_BUILTIN(BUILT_IN_VEC_NEW)
-DEF_UNUSED_BUILTIN(BUILT_IN_DELETE)
-DEF_UNUSED_BUILTIN(BUILT_IN_VEC_DELETE)
-
/* Declare abort, exit, _exit and _Exit */
-DEF_BUILTIN (BUILT_IN_ABORT,
- "__builtin_abort",
- NOT_BUILT_IN,
- BT_FN_VOID,
- BT_FN_VOID,
- 1, 0, 0,
- ATTR_NORETURN_NOTHROW_LIST, true)
-
-DEF_BUILTIN (BUILT_IN_EXIT,
- "__builtin_exit",
- NOT_BUILT_IN,
- BT_FN_VOID_INT,
- BT_FN_VOID_INT,
- 1, 0, 0,
- ATTR_NORETURN_NOTHROW_LIST, true)
-
-DEF_BUILTIN (BUILT_IN__EXIT,
- "__builtin__exit",
- NOT_BUILT_IN,
- BT_FN_VOID_INT,
- BT_FN_VOID_INT,
- 1, 0, 1,
- ATTR_NORETURN_NOTHROW_LIST, false)
-
-DEF_BUILTIN (BUILT_IN__EXIT2,
- "__builtin__Exit",
- NOT_BUILT_IN,
- BT_FN_VOID_INT,
- BT_FN_VOID_INT,
- 1, 0, !flag_isoc99,
- ATTR_NORETURN_NOTHROW_LIST, false)
+DEF_LIB_BUILTIN(BUILT_IN_ABORT,
+ "__builtin_abort",
+ BT_FN_VOID,
+ ATTR_NORETURN_NOTHROW_LIST)
+DEF_LIB_BUILTIN(BUILT_IN_EXIT,
+ "__builtin_exit",
+ BT_FN_VOID_INT,
+ ATTR_NORETURN_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN(BUILT_IN__EXIT,
+ "__builtin__exit",
+ BT_FN_VOID_INT,
+ ATTR_NORETURN_NOTHROW_LIST)
+DEF_C99_BUILTIN(BUILT_IN__EXIT2,
+ "__builtin__Exit",
+ BT_FN_VOID_INT,
+ ATTR_NORETURN_NOTHROW_LIST)
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 7547526..e148c2f 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1,4 +1,5 @@
-@c Copyright (C) 1988,1989,1992,1993,1994,1996,1998,1999,2000,2001,2002,2003 Free Software Foundation, Inc.
+@c Copyright (C) 1988,1989,1992,1993,1994,1996,1998,1999,2000,2001,2002,
+@c 2003 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -4537,6 +4538,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex atan2l
@findex bcmp
@findex bzero
+@findex ceil
+@findex ceilf
+@findex ceill
@findex cimag
@findex cimagf
@findex cimagl
@@ -4559,6 +4563,12 @@ v4si f (v4si a, v4si b, v4si c)
@findex fabsf
@findex fabsl
@findex ffs
+@findex floor
+@findex floorf
+@findex floorl
+@findex fmod
+@findex fmodf
+@findex fmodl
@findex fprintf
@findex fprintf_unlocked
@findex fputs
@@ -4573,12 +4583,18 @@ v4si f (v4si a, v4si b, v4si c)
@findex memcmp
@findex memcpy
@findex memset
+@findex nearbyint
+@findex nearbyintf
+@findex nearbyintl
@findex pow
@findex powf
@findex powl
@findex printf
@findex printf_unlocked
@findex rindex
+@findex round
+@findex roundf
+@findex roundl
@findex sin
@findex sinf
@findex sinl
@@ -4598,21 +4614,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex strrchr
@findex strspn
@findex strstr
-@findex floor
-@findex floorf
-@findex floorl
-@findex ceil
-@findex ceilf
-@findex ceill
-@findex round
-@findex roundf
-@findex roundl
@findex trunc
@findex truncf
@findex truncl
-@findex nearbyint
-@findex nearbyintf
-@findex nearbyintl
GCC provides a large number of built-in functions other than the ones
mentioned above. Some of these are for internal use in the processing
@@ -4633,39 +4637,36 @@ be emitted.
@opindex ansi
@opindex std
-The functions @code{abort}, @code{exit}, @code{_Exit} and @code{_exit}
-are recognized and presumed not to return, but otherwise are not built
-in. @code{_exit} is not recognized in strict ISO C mode (@option{-ansi},
-@option{-std=c89} or @option{-std=c99}). @code{_Exit} is not recognized in
-strict C89 mode (@option{-ansi} or @option{-std=c89}). All these functions
-have corresponding versions prefixed with @code{__builtin_}, which may be
-used even in strict C89 mode.
-
-Outside strict ISO C mode, the functions @code{alloca}, @code{bcmp},
-@code{bzero}, @code{index}, @code{rindex}, @code{ffs}, @code{fputs_unlocked},
-@code{printf_unlocked} and @code{fprintf_unlocked} may be handled as
-built-in functions. All these functions have corresponding versions
+Outside strict ISO C mode (@option{-ansi}, @option{-std=c89} or
+@option{-std=c99}), the functions @code{alloca}, @code{bcmp},
+@code{bzero}, @code{_exit}, @code{ffs}, @code{fprintf_unlocked},
+@code{fputs_unlocked}, @code{index}, @code{printf_unlocked},
+and @code{rindex} may be handled as built-in functions.
+All these functions have corresponding versions
prefixed with @code{__builtin_}, which may be used even in strict C89
mode.
The ISO C99 functions @code{conj}, @code{conjf}, @code{conjl}, @code{creal},
@code{crealf}, @code{creall}, @code{cimag}, @code{cimagf}, @code{cimagl},
+@code{_Exit},
@code{llabs}, @code{imaxabs}, @code{round}, @code{roundf}, @code{roundl},
@code{trunc}, @code{truncf}, @code{truncl}, @code{nearbyint},
@code{nearbyintf} and @code{nearbyintl} are handled as built-in functions
-except in strict ISO C90 mode.
+except in strict ISO C90 mode (@option{-ansi} or @option{-std=c89}).
There are also built-in versions of the ISO C99 functions @code{atan2f},
@code{atan2l}, @code{ceilf}, @code{ceill}, @code{cosf}, @code{cosl},
@code{expf}, @code{expl}, @code{fabsf}, @code{fabsl}, @code{floorf},
-@code{floorl}, @code{logf}, @code{logl}, @code{powf}, @code{powl},
+@code{floorl}, @code{fmodf}, @code{fmodl},
+@code{logf}, @code{logl}, @code{powf}, @code{powl},
@code{sinf}, @code{sinl}, @code{sqrtf} and @code{sqrtl}
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
corresponding versions prefixed with @code{__builtin_}.
-The ISO C90 functions @code{abs}, @code{atan2}, @code{ceil}, @code{cos},
-@code{exp}, @code{fabs}, @code{floor},
+The ISO C90 functions @code{abort}, @code{abs}, @code{atan2}, @code{ceil},
+@code{cos}, @code{exit},
+@code{exp}, @code{fabs}, @code{floor}, @code{fmod},
@code{fprintf}, @code{fputs}, @code{labs}, @code{log},
@code{memcmp}, @code{memcpy}, @code{memset}, @code{pow}, @code{printf},
@code{sin}, @code{sqrt}, @code{strcat}, @code{strchr}, @code{strcmp},
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index ef8e919..35460f5 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2003-02-25 Roger Sayle <roger@eyesopen.com>
+
+ * java/decl.c (java_init_decl_processing): Get soft_fmod_node from
+ built_in_decls[BUILT_IN_FMOD] rather than define it ourselves.
+
2003-02-23 Tom Tromey <tromey@redhat.com>
* lang-options.h: Added -Wdeprecated.
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 05f80ea..70d6e59 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -885,22 +885,6 @@ java_init_decl_processing (void)
build_function_type (ptr_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE);
- t = tree_cons (NULL_TREE, double_type_node,
- tree_cons (NULL_TREE, double_type_node, endlink));
- soft_fmod_node
- = builtin_function ("__builtin_fmod",
- build_function_type (double_type_node, t),
- BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmod", NULL_TREE);
-
-#if 0
- t = tree_cons (NULL_TREE, float_type_node,
- tree_cons (NULL_TREE, float_type_node, endlink));
- soft_fmodf_node
- = builtin_function ("__builtin_fmodf",
- build_function_type (float_type_node, t),
- BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmodf", NULL_TREE);
-#endif
-
soft_idiv_node
= builtin_function ("_Jv_divI",
build_function_type (int_type_node, t),
@@ -928,8 +912,13 @@ java_init_decl_processing (void)
lang_eh_runtime_type = prepare_eh_table_type;
init_jcf_parse ();
-
+
initialize_builtins ();
+
+ soft_fmod_node = built_in_decls[BUILT_IN_FMOD];
+#if 0
+ soft_fmodf_node = built_in_decls[BUILT_IN_FMODF];
+#endif
}