summaryrefslogtreecommitdiff
path: root/gcc/builtins.def
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-09 09:07:44 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-09 09:07:44 +0000
commit83d79705157d50abbd704a520e9bd0cf626607b5 (patch)
tree7e4c441f58d15d9c8077a944d506d9f9d2da8ba7 /gcc/builtins.def
parent47cf73fa40b9ff017869a07789d1527709efc59a (diff)
downloadgcc-83d79705157d50abbd704a520e9bd0cf626607b5.tar.gz
* builtins.c (c_strlen): Use TREE_STRING_LENGTH - 1 for max.
(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
Diffstat (limited to 'gcc/builtins.def')
-rw-r--r--gcc/builtins.def1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/builtins.def b/gcc/builtins.def
index 261c76a663c..980099c1b96 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -42,6 +42,7 @@ DEF_BUILTIN(BUILT_IN_STRLEN)
DEF_BUILTIN(BUILT_IN_STRSTR)
DEF_BUILTIN(BUILT_IN_STRPBRK)
DEF_BUILTIN(BUILT_IN_STRCHR)
+DEF_BUILTIN(BUILT_IN_STRRCHR)
DEF_BUILTIN(BUILT_IN_FSQRT)
DEF_BUILTIN(BUILT_IN_SIN)
DEF_BUILTIN(BUILT_IN_COS)