builtins.def [...]: Require an explicit ATTRS argument.

* builtins.def [DEF_GCC_BUILTIN]: Require an explicit ATTRS
	argument.  Mark BUILT_IN_RETURN, BUILT_IN_EH_RETURN,
	BUILT_IN_LONGJMP and BUILT_IN_TRAP as noreturn, the ISO C99
	floating point unordered comparisons (e.g. __builtin_isgreater)
	as const, and leave the remaining GCC_BUILTINs unchanged.

	* c-decl.c (builtin_function): No need to explicitly mark
	BUILT_IN_RETURN and BUILT_IN_EH_RETURN as noreturn.

	* cp/decl.c (builtin_function_1): No need to explicitly mark
	BUILT_IN_RETURN and BUILT_IN_EH_RETURN as noreturn.

From-SVN: r55805
This commit is contained in:
Roger Sayle 2002-07-28 05:34:04 +00:00 committed by Roger Sayle
parent 52bfebf091
commit c2ef6d3492
5 changed files with 86 additions and 44 deletions

View File

@ -1,3 +1,14 @@
2002-07-27 Roger Sayle <roger@eyesopen.com>
* builtins.def [DEF_GCC_BUILTIN]: Require an explicit ATTRS
argument. Mark BUILT_IN_RETURN, BUILT_IN_EH_RETURN,
BUILT_IN_LONGJMP and BUILT_IN_TRAP as noreturn, the ISO C99
floating point unordered comparisons (e.g. __builtin_isgreater)
as const, and leave the remaining GCC_BUILTINs unchanged.
* c-decl.c (builtin_function): No need to explicitly mark
BUILT_IN_RETURN and BUILT_IN_EH_RETURN as noreturn.
2002-07-27 Roger Sayle <roger@eyesopen.com>
* Makefile.in: rtlanal.o now depends upon real.h.

View File

@ -59,9 +59,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
compiler, but does not correspond to a function in the standard
library. */
#undef DEF_GCC_BUILTIN
#define DEF_GCC_BUILTIN(ENUM, NAME, TYPE) \
#define DEF_GCC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
false, false, false, ATTR_NULL)
false, false, false, ATTRS)
/* A fallback builtin is a builtin (like __builtin_puts) that falls
@ -364,49 +364,64 @@ DEF_UNUSED_BUILTIN(BUILT_IN_GETMAN)
DEF_GCC_BUILTIN(BUILT_IN_SAVEREGS,
"__builtin_saveregs",
BT_FN_PTR_VAR)
BT_FN_PTR_VAR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_CLASSIFY_TYPE,
"__builtin_classify_type",
BT_FN_INT_VAR)
BT_FN_INT_VAR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_NEXT_ARG,
"__builtin_next_arg",
BT_FN_PTR_VAR)
BT_FN_PTR_VAR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_ARGS_INFO,
"__builtin_args_info",
BT_FN_INT_INT)
BT_FN_INT_INT,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_CONSTANT_P,
"__builtin_constant_p",
BT_FN_INT_VAR)
BT_FN_INT_VAR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_FRAME_ADDRESS,
"__builtin_frame_address",
BT_FN_PTR_UNSIGNED)
BT_FN_PTR_UNSIGNED,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_RETURN_ADDRESS,
"__builtin_return_address",
BT_FN_PTR_UNSIGNED)
BT_FN_PTR_UNSIGNED,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_AGGREGATE_INCOMING_ADDRESS,
"__builtin_aggregate_incoming_address",
BT_FN_PTR_VAR)
BT_FN_PTR_VAR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_APPLY_ARGS,
"__builtin_apply_args",
BT_FN_PTR_VAR)
BT_FN_PTR_VAR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_APPLY,
"__builtin_apply",
BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE)
BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_RETURN,
"__builtin_return",
BT_FN_VOID_PTR)
BT_FN_VOID_PTR,
ATTR_NORETURN_NOTHROW_LIST)
DEF_GCC_BUILTIN(BUILT_IN_SETJMP,
"__builtin_setjmp",
BT_FN_INT_PTR)
BT_FN_INT_PTR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_LONGJMP,
"__builtin_longjmp",
BT_FN_VOID_PTR_INT)
BT_FN_VOID_PTR_INT,
ATTR_NORETURN_NOTHROW_LIST)
DEF_GCC_BUILTIN(BUILT_IN_TRAP,
"__builtin_trap",
BT_FN_VOID)
BT_FN_VOID,
ATTR_NORETURN_NOTHROW_LIST)
DEF_GCC_BUILTIN(BUILT_IN_PREFETCH,
"__builtin_prefetch",
BT_FN_VOID_CONST_PTR_VAR)
BT_FN_VOID_CONST_PTR_VAR,
ATTR_NULL)
/* Stdio builtins. */
DEF_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR,
@ -480,66 +495,85 @@ DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF_UNLOCKED,
/* ISO C99 floating point unordered comparisons. */
DEF_GCC_BUILTIN(BUILT_IN_ISGREATER,
"__builtin_isgreater",
BT_FN_INT_VAR)
BT_FN_INT_VAR,
ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN(BUILT_IN_ISGREATEREQUAL,
"__builtin_isgreaterequal",
BT_FN_INT_VAR)
BT_FN_INT_VAR,
ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN(BUILT_IN_ISLESS,
"__builtin_isless",
BT_FN_INT_VAR)
BT_FN_INT_VAR,
ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN(BUILT_IN_ISLESSEQUAL,
"__builtin_islessequal",
BT_FN_INT_VAR)
BT_FN_INT_VAR,
ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN(BUILT_IN_ISLESSGREATER,
"__builtin_islessgreater",
BT_FN_INT_VAR)
BT_FN_INT_VAR,
ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN(BUILT_IN_ISUNORDERED,
"__builtin_isunordered",
BT_FN_INT_VAR)
BT_FN_INT_VAR,
ATTR_CONST_NOTHROW_LIST)
/* Various hooks for the DWARF 2 __throw routine. */
DEF_GCC_BUILTIN(BUILT_IN_UNWIND_INIT,
"__builtin_unwind_init",
BT_FN_VOID)
BT_FN_VOID,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_DWARF_CFA,
"__builtin_dwarf_cfa",
BT_FN_PTR)
BT_FN_PTR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_DWARF_FP_REGNUM,
"__builtin_dwarf_fp_regnum",
BT_FN_UNSIGNED)
BT_FN_UNSIGNED,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_INIT_DWARF_REG_SIZES,
"__builtin_init_dwarf_reg_size_table",
BT_FN_VOID_PTR)
BT_FN_VOID_PTR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_FROB_RETURN_ADDR,
"__builtin_frob_return_addr",
BT_FN_PTR_PTR)
BT_FN_PTR_PTR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_EXTRACT_RETURN_ADDR,
"__builtin_extract_return_addr",
BT_FN_PTR_PTR)
BT_FN_PTR_PTR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN,
"__builtin_eh_return",
BT_FN_VOID_PTRMODE_PTR)
BT_FN_VOID_PTRMODE_PTR,
ATTR_NORETURN_NOTHROW_LIST)
DEF_GCC_BUILTIN(BUILT_IN_EH_RETURN_DATA_REGNO,
"__builtin_eh_return_data_regno",
BT_FN_INT_INT)
BT_FN_INT_INT,
ATTR_NULL)
/* Variable argument list (stdarg.h) support */
DEF_GCC_BUILTIN(BUILT_IN_VA_START,
"__builtin_va_start",
BT_FN_VOID_VALIST_REF_VAR)
BT_FN_VOID_VALIST_REF_VAR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_STDARG_START, /* backward compat */
"__builtin_stdarg_start",
BT_FN_VOID_VALIST_REF_VAR)
BT_FN_VOID_VALIST_REF_VAR,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_VA_END,
"__builtin_va_end",
BT_FN_VOID_VALIST_REF)
BT_FN_VOID_VALIST_REF,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_VA_COPY,
"__builtin_va_copy",
BT_FN_VOID_VALIST_REF_VALIST_ARG)
BT_FN_VOID_VALIST_REF_VALIST_ARG,
ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_EXPECT,
"__builtin_expect",
BT_FN_LONG_LONG_LONG)
BT_FN_LONG_LONG_LONG,
ATTR_NULL)
/* C++ extensions */
DEF_UNUSED_BUILTIN(BUILT_IN_NEW)

View File

@ -2966,10 +2966,6 @@ builtin_function (name, type, function_code, class, library_name, attrs)
DECL_BUILT_IN_CLASS (decl) = class;
DECL_FUNCTION_CODE (decl) = function_code;
/* The return builtins leave the current function. */
if (function_code == BUILT_IN_RETURN || function_code == BUILT_IN_EH_RETURN)
TREE_THIS_VOLATILE (decl) = 1;
/* Warn if a function in the namespace for users
is used without an occasion to consider it declared. */
if (name[0] != '_' || name[1] != '_')

View File

@ -1,3 +1,8 @@
2002-07-27 Roger Sayle <roger@eyesopen.com>
* decl.c (builtin_function_1): No need to explicitly mark
BUILT_IN_RETURN and BUILT_IN_EH_RETURN as noreturn.
2002-07-27 Roger Sayle <roger@eyesopen.com>
* decl2.c (cxx_decode_option): Support -fno-builtin-foo.

View File

@ -6755,10 +6755,6 @@ builtin_function_1 (name, type, context, code, class, libname, attrs)
DECL_FUNCTION_CODE (decl) = code;
DECL_CONTEXT (decl) = context;
/* The return builtins leave the current function. */
if (code == BUILT_IN_RETURN || code == BUILT_IN_EH_RETURN)
TREE_THIS_VOLATILE (decl) = 1;
pushdecl (decl);
/* Since `pushdecl' relies on DECL_ASSEMBLER_NAME instead of DECL_NAME,