diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f2dae16d87..98d6c34ceb6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2003-04-13 Roger Sayle + + * tree.h (DECL_BUILT_IN_NONANSI): Remove. + * c-common.c (builtin_function_2): Don't set DECL_BUILT_IN_NONANSI. + * c-decl.c (duplicate_decls): Use invariant DECL_BUILT_IN_NONANSI + implies DECL_BUILT_IN to simplify logic. + * print-tree.c (print_node): Don't dump DECL_BUILT_IN_NONANSI. + 2003-04-13 Roger Sayle * builtin-types.def (BT_FN_STRING_CONST_STRING): New builtin type. diff --git a/gcc/c-common.c b/gcc/c-common.c index a2cad233927..5d51579ff5d 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -3691,20 +3691,15 @@ builtin_function_2 (builtin_name, name, builtin_type, type, function_code, { tree bdecl = NULL_TREE; tree decl = NULL_TREE; + if (builtin_name != 0) - { - bdecl = builtin_function (builtin_name, builtin_type, function_code, - class, library_name_p ? name : NULL, - attrs); - } + bdecl = builtin_function (builtin_name, builtin_type, function_code, + class, library_name_p ? name : NULL, attrs); + if (name != 0 && !flag_no_builtin && !builtin_function_disabled_p (name) && !(nonansi_p && flag_no_nonansi_builtin)) - { - decl = builtin_function (name, type, function_code, class, NULL, - attrs); - if (nonansi_p) - DECL_BUILT_IN_NONANSI (decl) = 1; - } + decl = builtin_function (name, type, function_code, class, NULL, attrs); + return (bdecl != 0 ? bdecl : decl); } diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 3fc1808fe67..be6ff79059d 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -860,30 +860,16 @@ duplicate_decls (newdecl, olddecl, different_binding_level) if (TREE_CODE (olddecl) != TREE_CODE (newdecl)) { if (TREE_CODE (olddecl) == FUNCTION_DECL - && (DECL_BUILT_IN (olddecl) - || DECL_BUILT_IN_NONANSI (olddecl))) + && DECL_BUILT_IN (olddecl)) { /* If you declare a built-in or predefined function name as static, the old definition is overridden, but optionally warn this was a bad choice of name. */ if (!TREE_PUBLIC (newdecl)) { - if (!warn_shadow) - ; - else if (DECL_BUILT_IN (olddecl)) + if (warn_shadow) warning_with_decl (newdecl, "shadowing built-in function `%s'"); - else - warning_with_decl (newdecl, "shadowing library function `%s'"); } - /* Likewise, if the built-in is not ansi, then programs can - override it even globally without an error. */ - else if (! DECL_BUILT_IN (olddecl)) - warning_with_decl (newdecl, - "library function `%s' declared as non-function"); - - else if (DECL_BUILT_IN_NONANSI (olddecl)) - warning_with_decl (newdecl, - "built-in function `%s' declared as non-function"); else warning_with_decl (newdecl, "built-in function `%s' declared as non-function"); diff --git a/gcc/print-tree.c b/gcc/print-tree.c index cd180719d67..bb1230d24b4 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -1,6 +1,6 @@ /* Prints out tree in human readable form - GNU C-compiler Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 Free Software Foundation, Inc. + 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -336,8 +336,6 @@ print_node (file, prefix, node, indent) fputs (" inline", file); if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN (node)) fputs (" built-in", file); - if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN_NONANSI (node)) - fputs (" built-in-nonansi", file); if (TREE_CODE (node) == FUNCTION_DECL && DECL_NO_STATIC_CHAIN (node)) fputs (" no-static-chain", file); diff --git a/gcc/tree.h b/gcc/tree.h index 70d746394d7..c72e3d022c6 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -236,8 +236,6 @@ struct tree_common GTY(()) TREE_UNSIGNED in INTEGER_TYPE, ENUMERAL_TYPE, FIELD_DECL - DECL_BUILT_IN_NONANSI in - FUNCTION_DECL SAVE_EXPR_NOPLACEHOLDER in SAVE_EXPR @@ -635,8 +633,7 @@ extern void tree_operand_check_failed PARAMS ((int, enum tree_code, #define TREE_CONSTANT(NODE) ((NODE)->common.constant_flag) /* In INTEGER_TYPE or ENUMERAL_TYPE nodes, means an unsigned type. - In FIELD_DECL nodes, means an unsigned bit field. - The same bit is used in functions as DECL_BUILT_IN_NONANSI. */ + In FIELD_DECL nodes, means an unsigned bit field. */ #define TREE_UNSIGNED(NODE) ((NODE)->common.unsigned_flag) #define TYPE_TRAP_SIGNED(NODE) \ @@ -1687,12 +1684,6 @@ struct tree_type GTY(()) /* List of FUNCTION_DECLs inlined into this function's body. */ #define DECL_INLINED_FNS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.inlined_fns) -/* Nonzero in a FUNCTION_DECL means this is a built-in function - that is not specified by ansi C and that users are supposed to be allowed - to redefine for any purpose whatever. */ -#define DECL_BUILT_IN_NONANSI(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->common.unsigned_flag) - /* Nonzero in a FUNCTION_DECL means this function should be treated as if it were a malloc, meaning it returns a pointer that is not an alias. */