From: sayle Date: Sun, 28 Jul 2002 05:34:04 +0000 (+0000) Subject: * builtins.def [DEF_GCC_BUILTIN]: Require an explicit ATTRS X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=8a007b43216d680ce214e65284a165d490804102;p=pf3gnuchains%2Fgcc-fork.git * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55805 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cc9307ec797..22d5237c125 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,16 @@ 2002-07-27 Roger Sayle + * 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 + * Makefile.in: rtlanal.o now depends upon real.h. * flags.h [flag_signaling_nans]: New flag. diff --git a/gcc/builtins.def b/gcc/builtins.def index 40f5ccd86df..7be8fe14eb6 100644 --- a/gcc/builtins.def +++ b/gcc/builtins.def @@ -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) diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 61874438b0c..61cafffdeef 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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] != '_') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8e5a93377b0..1415aed531e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2002-07-27 Roger Sayle + * 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 + * decl2.c (cxx_decode_option): Support -fno-builtin-foo. 2002-07-26 Jason Merrill diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 14021a411d1..d9f338aacc0 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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,