aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtin-attrs.def
AgeCommit message (Collapse)AuthorFilesLines
2005-03-14builtin-attrs.def (ATTR_NOVOPS, [...]): New.Zdenek Dvorak1-0/+5
* builtin-attrs.def (ATTR_NOVOPS, ATTR_NOVOPS_LIST, ATTR_PURE_NOTHROW_NOVOPS_LIST): New. * builtins.def (ATTR_MATHFN_FPROUNDING): Use NOVOPS. (BUILT_IN_PREFETCH): Set the NOVOPS attribute. * c-common.c (handle_novops_attribute): New function. (c_common_attribute_table): Add "no vops" entry. * c-decl.c (merge_decls): Copy DECL_IS_NOVOPS. * calls.c (flags_from_decl_or_type): Set ECF_NOVOPS. * tree-ssa-operands.c (get_call_expr_operands): Do not create virtual operands for calls with ECF_NOVOPS flag. * tree.h (DECL_IS_NOVOPS): New macro. (struct tree_decl): Add novops_flag. (ECF_NOVOPS): New constant. From-SVN: r96438
2005-03-13builtin-attrs.def, [...]: Update copyright.Kazu Hirata1-1/+1
* builtin-attrs.def, c-lex.c, c-pragma.h, reg-stack.c, config/mips/vr.h: Update copyright. From-SVN: r96369
2005-03-11builtin-attrs.def (ATTR_NONNULL_LIST, [...]): New "nonnull" attribute lists ↵Kaveh R. Ghazi1-24/+20
which are non-specific regarding the nonnull... * builtin-attrs.def (ATTR_NONNULL_LIST, ATTR_NOTHROW_NONNULL, ATTR_CONST_NOTHROW_NONNULL, ATTR_PURE_NOTHROW_NONNULL, ATTR_MALLOC_NOTHROW_NONNULL): New "nonnull" attribute lists which are non-specific regarding the nonnull parameter positions. (ATTR_NONNULL_1_2, ATTR_NONNULL_1_4, ATTR_NOTHROW_NONNULL_1_2, ATTR_NOTHROW_NONNULL_1_4, ATTR_CONST_NOTHROW_NONNULL_1, ATTR_PURE_NOTHROW_NONNULL_1, ATTR_PURE_NOTHROW_NONNULL_1_2, ATTR_MALLOC_NOTHROW_NONNULL_1): Delete. * builtins.def: Use the non-specific "nonnull" attibute lists. From-SVN: r96298
2004-10-15bitmap.c, [...]: Update copyright.Kazu Hirata1-1/+1
* bitmap.c, bitmap.h, builtin-attrs.def, cfglayout.h, collect2.h, conflict.c, coretypes.h, coverage.h, errors.h, gcc.h, gcov-dump.c, gen-protos.c, gencheck.c, gencodes.c, genconstants.c, gengenrtl.c, genmodes.c, genpeep.c, gensupport.h, graph.h, gthr-gnat.c, gthr-gnat.h, gthr-posix.c, gthr-posix.h, hard-reg-set.h, hwint.h, integrate.h, libgcc2.c, lists.c, machmode.def, mips-tdump.c, opts.h, params.c, predict.def, predict.h, protoize.c, reload.h, resource.h, rtl-error.c, sbitmap.c, sbitmap.h, sreal.c, tlink.c, tree-dump.h, tree-inline.h, unwind-dw2-fde.c, unwind-dw2.c, unwind-sjlj.c, value-prof.h: Update copyright. From-SVN: r89097
2004-09-29builtins.def (BUILT_IN_FPUTC, [...]): Remove nothrow attribute.Jakub Jelinek1-0/+8
* builtins.def (BUILT_IN_FPUTC, BUILT_IN_FPUTC_UNLOCKED, BUILT_IN_FPUTS, BUILT_IN_FPUTS_UNLOCKED, BUILT_IN_FWRITE, BUILT_IN_FWRITE_UNLOCKED, BUILT_IN_PUTCHAR, BUILT_IN_PUTCHAR_UNLOCKED, BUILT_IN_PUTS, BUILT_IN_PUTS_UNLOCKED): Remove nothrow attribute. * builtin-attrs.def (ATTR_NONNULL_1, ATTR_NONNULL_2, ATTR_NONNULL_1_2, ATTR_NONNULL_1_4): New. From-SVN: r88278
2004-09-05builtin-attrs.def (ATTR_NOTHROW_SENTINEL_1): New.Kaveh R. Ghazi1-0/+2
* builtin-attrs.def (ATTR_NOTHROW_SENTINEL_1): New. * builtins.def (BUILT_IN_EXECLE): Set ATTR_NOTHROW_SENTINEL_1. * c-common.c (c_common_attribute_table): Accept parameters to sentinel attribute. (check_function_sentinel, handle_sentinel_attribute): Likewise. * doc/extend.texi: Update accordingly. testsuite: * gcc.dg/format/sentinel-1.c: Update for parameter option. From-SVN: r87098
2004-09-05builtin-attrs.def (ATTR_SENTINEL, [...]): New.Kaveh Ghazi1-0/+3
gcc: * builtin-attrs.def (ATTR_SENTINEL, ATTR_SENTINEL_NOTHROW_LIST): New. * builtins.def (BUILT_IN_EXECL, BUILT_IN_EXECLP): Add `sentinel' attribute. * c-common.c (handle_sentinel_attribute, check_function_sentinel): New functions. (c_common_attribute_table): Add `sentinel' attribute. (check_function_arguments): Handle `sentinel' attribute. * doc/extend.texi: Document `sentinel' attribute. gcc/testsuite: * gcc.dg/format/sentinel-1.c: New test. include: * ansidecl.h (ATTRIBUTE_SENTINEL): Define. * libiberty.h (concat, reconcat, concat_length, concat_copy, concat_copy2): Use ATTRIBUTE_SENTINEL. From-SVN: r87096
2004-05-11Fix typo.Mike Stump1-1/+1
From-SVN: r81717
2003-08-22builtin-attrs.def: Fix comment formatting.Kazu Hirata1-6/+6
* builtin-attrs.def: Fix comment formatting. * c-pretty-print.c: Likewise. * diagnostic.h: Likewise. * langhooks.h: Likewise. * recog.c: Likewise. * simplify-rtx.c: Likewise. * tree.def: Likewise. From-SVN: r70676
2003-08-03builtin-types.def (BT_SSIZE): New primitive type.Roger Sayle1-47/+1
* builtin-types.def (BT_SSIZE): New primitive type. (BT_FN_INT_PTR_CONST_STRING_VALIST_ARG, BT_FN_STRING_CONST_STRING_CONST_STRING_INT, BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR, BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR): New function types. * builtins.def (BUILT_IN_DCGETTEXT, BUILT_IN_DGETTEXT, BUILT_IN_FSCANF, BUILT_IN_GETTEXT, BUILT_IN_STRFMON, BUILT_IN_STRFTIME, BUILT_IN_VFPRINTF, BUILT_IN_VFSCANF): New builtins. * builtin-attrs.def: Remove DEF_FN_ATTR construct and the last few functions that define default attributes using it. * c-common.c (c_common_insert_default_attributes): Do nothing. * doc/extend.texi: Document these "new" builtins. From-SVN: r70113
2003-06-30builtin-attrs.def (gcc_diag, [...]): New format attributes.Kaveh R. Ghazi1-0/+3
gcc: * builtin-attrs.def (gcc_diag, gcc_cdiag, gcc_cxxdiag): New format attributes. * c-format.c (enum format_type): Add gcc_diag_format_type, gcc_cdiag_format_type, and gcc_cxxdiag_format_type. (gcc_diag_length_specs, gcc_cdiag_length_specs, gcc_cxxdiag_length_specs, gcc_diag_flag_pairs, gcc_cdiag_flag_pairs, gcc_cxxdiag_flag_pairs, gcc_diag_flag_specs, gcc_cdiag_flag_specs, gcc_cxxdiag_flag_specs, gcc_diag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table): New. (format_types_orig): Add new data. (find_char_info_specifier_index, init_dynamic_diag_info): New functions. (handle_format_attribute): Update to handle new format attributes. testsuite: * gcc.dg/format/gcc_diag-1.c: New test. From-SVN: r68689
2003-06-16builtin-attrs.def, [...]: Don't use macros from "symcat.h", instead rely on ↵Kaveh R. Ghazi1-15/+13
ISO C. * builtin-attrs.def, builtin-attrs.def, builtins.c, cpplex.c, cpplib.c, gencheck.c, gengenrtl.c, machmode.def, protoize.c: Don't use macros from "symcat.h", instead rely on ISO C. * system.h: Don't include "symcat.h". * configure.in (AC_C_STRINGIZE): Delete. * config.in, configure: Regenerate. From-SVN: r68035
2003-06-02builtin-attrs.def (ATTR_ASM_FPRINTF): New.Kaveh R. Ghazi1-0/+1
* builtin-attrs.def (ATTR_ASM_FPRINTF): New. * c-format.c (enum format_type): Add asm_fprintf_format_type. (NOARGUMENTS, asm_fprintf_length_specs, asm_fprintf_flag_specs, asm_fprintf_flag_pairs, asm_fprintf_char_table): New. (format_types_orig): Renamed from format_types. Add new data. (format_types): Declare as pointer. (handle_format_attribute): Move later in file so we have all necessary declarations. Add section to capture HOST_WIDE_INT. * output.h (ATTRIBUTE_ASM_FPRINTF, __gcc_host_wide_int__): New. (asm_fprintf): Mark with ATTRIBUTE_ASM_FPRINTF. From-SVN: r67319
2003-05-04builtin-attrs.def (ATTR_NOTHROW_NONNULL_1, [...]): Renamed from ↵Kaveh R. Ghazi1-5/+23
ATTR_NONNULL_1, ATTR_NONNULL_2 and ATTR_NONNULL_3. gcc: * builtin-attrs.def (ATTR_NOTHROW_NONNULL_1, ATTR_NOTHROW_NONNULL_2, ATTR_NOTHROW_NONNULL_3): Renamed from ATTR_NONNULL_1, ATTR_NONNULL_2 and ATTR_NONNULL_3. (ATTR_NOTHROW_NONNULL_1_2, ATTR_NOTHROW_NONNULL_1_4, ATTR_CONST_NOTHROW_NONNULL_1, ATTR_PURE_NOTHROW_NONNULL_1, ATTR_PURE_NOTHROW_NONNULL_1_2, ATTR_MALLOC_NOTHROW_NONNULL_1): New. * builtins.def (DEF_EXT_FALLBACK_BUILTIN): Accept ATTRS argument. (BUILT_IN_BZERO, BUILT_IN_BCOPY, BUILT_IN_BCMP): Update comment (BUILT_IN_INDEX, BUILT_IN_RINDEX, BUILT_IN_MEMCPY, BUILT_IN_MEMMOVE, BUILT_IN_MEMCMP, BUILT_IN_MEMSET, BUILT_IN_MEMPCPY, BUILT_IN_STRCAT, BUILT_IN_STRNCAT, BUILT_IN_STPCPY, BUILT_IN_STRCPY, BUILT_IN_STRNCPY, BUILT_IN_STRCMP, BUILT_IN_STRNCMP, BUILT_IN_STRLEN, BUILT_IN_STRSTR, BUILT_IN_STRPBRK, BUILT_IN_STRSPN, BUILT_IN_STRCSPN, BUILT_IN_STRCHR, BUILT_IN_STRRCHR, BUILT_IN_NAN, BUILT_IN_NANF, BUILT_IN_NANL, BUILT_IN_NANS, BUILT_IN_NANSF, BUILT_IN_NANSL, BUILT_IN_PUTS, BUILT_IN_FPUTC, BUILT_IN_FPUTS, BUILT_IN_FWRITE, BUILT_IN_PUTS_UNLOCKED, BUILT_IN_FPUTC_UNLOCKED, BUILT_IN_FPUTS_UNLOCKED, BUILT_IN_FWRITE_UNLOCKED, BUILT_IN_STRDUP): Add "nonnull" attribute. testsuite: * gcc.dg/nonnull-3.c: New test. From-SVN: r66468
2003-03-02re PR c++/9367 (error: nonnull argument with extern "C" snprintf prototype)Roger Sayle1-12/+6
PR c++/9367 * builtin-types.def (DEF_FUNCTION_TYPE_VAR_3): New macro. (BT_FN_INT_CONST_STRING_VALIST_ARG, BT_FN_INT_STRING_CONST_STRING_VALIST_ARG, BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG, BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG, BT_FN_INT_STRING_CONST_STRING_VAR, BT_FN_INT_CONST_STRING_CONST_STRING_VAR, BT_FN_INT_STRING_SIZE_CONST_STRING_VAR): New built-in types. * builtin-attrs.def (ATTR_NONNULL_1, ATTR_NONNULL_2, ATTR_NONNULL_3): Also include the nothrow attribute. (sprintf, scanf, sscanf, vprintf, vsprintf, snprintf, vsnprintf, vscanf, vsscanf): Don't define attributes here. * builtins.def (putchar, puts): Make full C89 built-ins. (snprintf, sprintf, scanf, sscanf, vprintf, vscanf, vsscanf, vsnprintf, vsprintf): New built-ins. * c-common.c (c_common_nodes_and_builtins): Handle new macro DEF_FUNCTION_TYPE_VAR_3. * doc/extend.texi: Document these new built-in functions. * java/builtins.c (builtin_type): Handle DEF_FUNCTION_TYPE_VAR_3. (initialize_builtins): Handle DEF_FUNCTION_TYPE_VAR_3. * g++.old-deja/g++.other/builtins10.C: New test for PR 9367. * gcc.dg/format/attr-5.c: Handle new conflicting types warning. From-SVN: r63650
2002-07-06re PR c++/7099 (G++ doesn't set the noreturn attribute on std::exit and ↵Roger Sayle1-16/+19
std::abort) PR c++/7099 * builtin-attrs.def: Define new attribute lists for use in builtins.def. * builtins.def [DEF_BUILTIN]: Modify to take an additional ATTRS argument, an enumerated value defined in builtin-attrs.def that represents the attribute list for the builtins. Modify all builtin functions to pass an appropriate attribute list. Specify "abort", "exit", "_exit" and "_Exit" builtins here with their required noreturn attributes. * tree.h (enum_builtin_function): Ignore the additional parameter to DEF_BUILTIN. * builtins.c (built_in_names): Likewise. * c-common.c: (builtin_function_2): Replace the "int noreturn_p" argument with a tree representing the functions attribute list. Pass this "attrs" argument to builtin_function. No longer handle the noreturn_p processing manually. (built_in_attributes): Move the definitions from builtin-attrs.def before c_common_nodes_and_builtins. (c_common_nodes_and_builtins): Handle the new ATTRS parameter in DEF_BUILTIN, passing it to both builtin_function and the changed builtin_function_2. * doc/extend.texi: Document __builtin_abort, __builtin_exit, __builtin__exit and __builtin__Exit. * java/builtins.c (initialize_builtins): Ignore the additional parameter to DEF_BUILTIN. Handle more C/C++ specific junk in the builtins.def file. From-SVN: r55276
2002-05-23builtin-attrs.def: Update copyright years.Jason Thorpe1-17/+28
* builtin-attrs.def: Update copyright years. (ATTR_NONNULL): New attribute identifier. (ATTR_NONNULL_1, ATTR_NONNULL_2, ATTR_NONNULL_3): New attribute tree lists. (DEF_FORMAT_ATTRIBUTE): Chain a nonnull attribute for the format operand. (ATTR_FORMAT_ARG_1, ATTR_FORMAT_ARG_2): Use... (DEF_FORMAT_ARG_ATTRIBUTE): ...this to generate format_arg attribute lists. Chain the appropriate nonnull attribute. * c-format.c (check_format_arg): Remove null format string warning. * testsuite/gcc.dg/format/null-1.c: New test. From-SVN: r53801
2001-12-21builtin-attrs.def (__builtin_printf_unlocked, [...]): Mark with the ↵Kaveh R. Ghazi1-0/+5
__printf__ attribute. * builtin-attrs.def (__builtin_printf_unlocked, __builtin_fprintf_unlocked, printf_unlocked, fprintf_unlocked): Mark with the __printf__ attribute. * builtins.c (expand_builtin_fputs): Add an `unlocked' parameter and set the replacement function depending on it. (expand_builtin): Skip BUILT_IN_*_UNLOCKED when not optimizing. Handle BUILT_IN_*_UNLOCKED when optimizing. * builtins.def (DEF_EXT_FALLBACK_BUILTIN, DEF_EXT_FRONT_END_LIB_BUILTIN): New macros. Declare the "unlocked" stdio functions. * c-common.c (c_expand_builtin_printf, c_expand_builtin_fprintf): Add an `unlocked' parameter and set the replacement function depending on it. (c_expand_builtin): Handle BUILT_IN_PRINTF_UNLOCKED and BUILT_IN_FPRINTF_UNLOCKED. * doc/extend.texi (printf_unlocked, fprintf_unlocked, fputs_unlocked): Document. testsuite: * gcc.dg/format/builtin-1.c: Test unlocked stdio. * gcc.dg/format/c90-printf-3.c: Likewise. * gcc.dg/format/c99-printf-3.c: Likewise. * gcc.dg/format/ext-1.c: Likewise. * gcc.dg/format/ext-6.c: Likewise. * gcc.dg/format/format.h: Prototype unlocked stdio. From-SVN: r48229
2001-10-02attribs.c (decl_attributes): Possibly call insert_default_attributes to ↵Joseph Myers1-0/+166
insert default attributes on... * attribs.c (decl_attributes): Possibly call insert_default_attributes to insert default attributes on functions in a lazy manner. * builtin-attrs.def: New file; define the default format and format_arg attributes. * c-common.c (c_format_attribute_table): Move to earlier in the file. (c_common_nodes_and_builtins): Initialize format_attribute_table. (enum built_in_attribute, built_in_attributes, c_attrs_initialized, c_init_attributes, c_common_insert_default_attributes): New. (c_common_lang_init): Don't initialize format_attribute_table. Do call c_init_attributes. * Makefile.in (c-common.o): Depend on builtin-attrs.def. * c-common.h (init_function_format_info): Don't declare. (c_common_insert_default_attributes): Declare. * c-decl.c (implicitly_declare, builtin_function): Call decl_attributes. (init_decl_processing): Don't call init_function_format_info. (insert_default_attributes): New. * c-format.c (handle_format_attribute, handle_format_arg_attribute): Be quiet about inappropriate declaration when applying default attributes. (init_function_format_info): Remove. * tree.h (enum attribute_flags): Add ATTR_FLAG_BUILT_IN. (insert_default_attributes): Declare. cp: * decl.c (init_decl_processing): Don't call init_function_format_info. Initialize lang_attribute_table earlier. (builtin_function): Call decl_attributes. (insert_default_attributes): New. testsuite: * gcc.dg/format/attr-5.c, gcc.dg/format/attr-6.c: New tests. From-SVN: r45942