summaryrefslogtreecommitdiffstats
path: root/gcc/builtins.def
Commit message (Collapse)AuthorAgeFilesLines
* * builtins.def (BUILT_IN_FPRINTF): New entry.ghazi2001-01-071-0/+1
| | | | | | | | | | | | | | | | | * c-common.c (c_expand_builtin_fprintf): New function. (init_function_format_info): Handle __builtin_fprintf. (c_common_nodes_and_builtins): Declare fprintf/__builtin_fprintf. (c_expand_builtin): Handle BUILT_IN_FPRINTF. * c-decl.c (duplicate_decls): Adjust comment. * extend.texi (fprintf): Document new builtin. testsuite: * gcc.c-torture/execute/stdio-opt-3.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38788 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.def (BUILT_IN_CONJ, BUILT_IN_CREAL, BUILT_IN_CIMAG):jsm282001-01-051-1/+4
| | | | | | | | | | | | | | | | | Define. * builtins.c (expand_builtin): Abort on BUILT_IN_CONJ, BUILT_IN_CREAL and BUILT_IN_CIMAG. * c-common.c (c_common_nodes_and_builtins): Create builtin conjf, conj, conjl, crealf, creal, creall, cimagf, cimag and cimagl. (expand_tree_builtin): Handle BUILT_IN_CONJ, BUILT_IN_CREAL and BUILT_IN_CIMAG. * extend.texi: Document these builtins. testsuite: * gcc.c-torture/execute/builtin-complex-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38716 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.def (BUILT_IN_LABS, BUILT_IN_LLABS, BUILT_IN_IMAXABS):jsm282000-12-231-3/+0
| | | | | | | | | | | | | Don't define. * builtins.c (expand_builtin): Don't handle BUILT_IN_LABS, BUILT_IN_LLABS and BUILT_IN_IMAXABS. * c-common.c (c_common_nodes_and_builtins): Use BUILT_IN_ABS for builtin labs, llabs and imaxabs. (expand_tree_builtin): Don't handle BUILT_IN_LABS, BUILT_IN_LLABS and BUILT_IN_IMAXABS. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38475 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (expand_builtin_strcat, expand_builtin_strncat,ghazi2000-12-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | expand_builtin_strspn, expand_builtin_strcspn): New functions. (expand_builtin): Handle BUILT_IN_STRCAT, BUILT_IN_STRNCAT, BUILT_IN_STRSPN and BUILT_IN_STRCSPN. * builtins.def (BUILT_IN_STRCAT, BUILT_IN_STRNCAT, BUILT_IN_STRSPN, BUILT_IN_STRCSPN): New entries. * c-common.c (c_common_nodes_and_builtins): Declare builtin strcat, strncat, strspn and strcspn. (string_ftype_string_cstring): Renamed from `string_ftype_ptr_ptr'. * extend.texi (strcat, strcspn, strncat, strspn): Document new builtins. testsuite: * gcc.c-torture/execute/string-opt-9.c: New test. * gcc.c-torture/execute/string-opt-10.c: Likewise. * gcc.c-torture/execute/string-opt-11.c: Likewise. * gcc.c-torture/execute/string-opt-12.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37964 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.def (BUILT_IN_IMAXABS): Add.jsm282000-12-011-0/+1
| | | | | | | | | | | | * builtins.c (expand_builtin): Also abort on BUILT_IN_IMAXABS. * c-common.c (c_common_nodes_and_builtins): Create builtin functions __builtin_imaxabs, and plain imaxabs unless flag_no_nonansi_builtin outside C99 mode. (expand_tree_builtin): Handle BUILT_IN_IMAXABS. * extend.texi: Document builtin imaxabs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37932 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (expand_builtin_strncmp, expand_builtin_strncpy): Newghazi2000-11-271-0/+2
| | | | | | | | | | | | | | | | | | | functions. (expand_builtin): Handle BUILT_IN_STRNCPY and BUILT_IN_STRNCMP. * builtins.def (BUILT_IN_STRNCPY, BUILT_IN_STRNCMP): New entries. * c-common.c (c_common_nodes_and_builtins): Declare builtin strncpy and strncmp. * extend.texi (strncmp, strncpy): Document new builtins. testsuite: * gcc.c-torture/execute/string-opt-7.c: New test. * gcc.c-torture/execute/string-opt-8.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37777 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (expand_builtin): Handle BUILT_IN_INDEX andghazi2000-11-131-0/+2
| | | | | | | | | | | | | | | | | | | BUILT_IN_RINDEX. Add missing checks for BUILT_IN_STRCHR and BUILT_IN_STRRCHR. * builtins.def (BUILT_IN_INDEX, BUILT_IN_RINDEX): New entries. * c-common.c (c_common_nodes_and_builtins): Declare index and rindex when nonansi builtins are allowed. * extend.texi (index, rindex): Document new builtins. testsuite: * gcc.c-torture/execute/string-opt-3.c: Also test builtin rindex. * gcc.c-torture/execute/string-opt-4.c: Also test builtin index. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37416 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (c_strlen): Use TREE_STRING_LENGTH - 1 for max.jakub2000-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | (c_getstr): New function. (expand_builtin_strstr): Do nothing if -fcheck-memory-usage. If both arguments are constant string, optimize out. (expand_builtin_strchr, expand_builtin_strrchr): New functions. (expand_builtin_strpbrk): Use c_getstr, do nothing if -fcheck-memory-usage. (expand_builtin_fputs): Likewise. (expand_builtin_strcmp): Add MODE argument. Use even if !HAVE_cmpstrsi. Optimize the case when both arguments are constant strings. (expand_builtin): Adjust expand_builtin_strcmp caller. Call expand_builtin_strchr and expand_builtin_strrchr. * c-common.c (c_common_nodes_and_builtins): Add strchr and strrchr builtins. * builtins.def (BUILT_IN_STRRCHR): Add. * gcc.c-torture/execute/string-opt-1.c: Add test for strstr with both arguments constant strings. * gcc.c-torture/execute/string-opt-3.c: New test. * gcc.c-torture/execute/string-opt-4.c: New test. * gcc.c-torture/execute/string-opt-5.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37338 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (expand_builtin_strpbrk): New function.ghazi2000-11-071-0/+1
| | | | | | | | | | | | | | | (expand_builtin): Handle BUILT_IN_STRPBRK. * builtins.def (BUILT_IN_STRPBRK): New entry. * c-common.c (c_common_nodes_and_builtins): Declare builtin strpbrk. testsuite: * gcc.c-torture/execute/string-opt-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37291 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (expand_builtin_strstr): New function.ghazi2000-11-011-0/+2
| | | | | | | | | | | | (expand_builtin): Handle BUILT_IN_STRSTR and BUILT_IN_STRCHR. * builtins.def (BUILT_IN_STRSTR, BUILT_IN_STRCHR): New entries. * c-common.c (c_common_nodes_and_builtins): Declare builtin strstr and builtin strchr. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37181 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.def (BUILT_IN_LLABS): Add.jsm282000-09-241-0/+1
| | | | | | | | | | | * builtins.c (expand_builtin): Also abort on BUILT_IN_LLABS. * c-common.c (c_common_nodes_builtins): Create builtin functions __builtin_llabs, and plain llabs unless no_nonansi_builtins outside of C99 mode. (expand_tree_builtin): Handle BUILT_IN_LLABS. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36585 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (expand_builtin_fputs): Also expand when length!=1.ghazi2000-09-211-0/+1
| | | | | | | | | | | (expand_builtin): Handle BUILT_IN_FWRITE. * builtins.def (BUILT_IN_FWRITE): New entry. * c-common.c (c_common_nodes_and_builtins): Declare __builtin_fwrite. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36556 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (is_valid_printf_arglist, expand_builtin_printf): Newghazi2000-09-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | functions. (expand_builtin_fputs): Set `target' parameter for `expand_expr'. (expand_builtin): Handle BUILT_IN_PUTCHAR, BUILT_IN_PUTS and BUILT_IN_PRINTF. * builtins.def (BUILT_IN_PUTCHAR, BUILT_IN_PUTS, BUILT_IN_PRINTF): New entries. * c-common.c (init_function_format_info): Handle __builtin_printf. Set `check_function_format_ptr'. (c_common_nodes_and_builtins): Set `puts_ftype' and `printf_ftype'. Declare __builtin_putchar, __builtin_puts, __builtin_printf and printf. * tree.c, tree.h (check_function_format_ptr): Declare. testsuite: * g++.old-deja/g++.other/virtual8.C: Declare printf correctly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36540 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (built_in_decls): New array.ghazi2000-09-121-0/+4
| | | | | | | | | | | | | | (expand_builtin_fputs): New function. (expand_builtin): Handle BUILT_IN_FPUTC and BUILT_IN_FPUTS. * builtins.def (BUILT_IN_FPUTC, BUILT_IN_FPUTS): New members. * c-common.c (c_common_nodes_and_builtins): Handle fputc/fputs. * tree.h (built_in_decls): New array. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36363 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (expand_builtin_expect): New.rth2000-04-171-0/+1
| | | | | | | | | | | | | | | | | | | | | (expand_builtin): Call it. * builtins.def (BUILT_IN_EXPECT): New. * c-common.c (c_common_nodes_and_builtins): Declare __builtin_expect. * extend.texi: Document it. * predict.c (expected_value_to_br_prob): New. (find_expected_value): New. * basic-block.h (expected_value_to_br_prob): Declare. * toplev.c (rest_of_compilation): Invoke it. * rtl.h (NOTE_EXPECTED_VALUE): New. (NOTE_INSN_EXPECTED_VALUE): New. * rtl.c (note_insn_name): Update. * print-rtl.c (print_rtx): Reorg NOTE_LINE_NUMBER special cases; handle NOTE_INSN_EXPECTED_VALUE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33211 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (expand_builtin_bzero): New function.ghazi2000-03-241-0/+1
| | | | | | | | | | | | (expand_builtin): Handle bzero. * builtins.def: Add BUILT_IN_BZERO. * c-common.c (c_common_nodes_and_builtins): Provide builtin prototype & function for bzero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32727 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.c (expand_builtin): Handle bcmp.ghazi2000-03-231-0/+1
| | | | | | | | | | * builtins.def: Add BUILT_IN_BCMP. * c-common.c (c_common_nodes_and_builtins): Provide builtin prototype & function for bcmp. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32715 138bc75d-0d04-0410-961f-82ee72b054a4
* * builtins.def: New file.ghazi2000-03-231-0/+85
* Makefile.in (TREE_H): Depend on builtins.def. * builtins.c (built_in_names): Use builtins.def. * tree.h (built_in_function): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32695 138bc75d-0d04-0410-961f-82ee72b054a4
OpenPOWER on IntegriCloud