aboutsummaryrefslogtreecommitdiff
path: root/gcc/libgcc1.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2000-11-09 10:07:44 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2000-11-09 10:07:44 +0100
commit2dee4af12b1f2a1262a88bdfa40e5a9db5374663 (patch)
tree7e4c441f58d15d9c8077a944d506d9f9d2da8ba7 /gcc/libgcc1.c
parent54d87db8696d7dd6307ba7f5e54ec27a22d42348 (diff)
downloadgcc-2dee4af12b1f2a1262a88bdfa40e5a9db5374663.zip
gcc-2dee4af12b1f2a1262a88bdfa40e5a9db5374663.tar.gz
gcc-2dee4af12b1f2a1262a88bdfa40e5a9db5374663.tar.bz2
builtins.c (c_strlen): Use TREE_STRING_LENGTH - 1 for max.
* 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. From-SVN: r37338
Diffstat (limited to 'gcc/libgcc1.c')
0 files changed, 0 insertions, 0 deletions