diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2000-11-13 02:14:05 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2000-11-13 02:14:05 +0000 |
commit | c7b6c6cd4791c3003397feea31482c3d19419fe2 (patch) | |
tree | e2619415f3516210288dc043ad4cdec1be4247a5 /gcc/builtins.c | |
parent | 34f6fbdb65c5e2a8ff1c6553592503532ef0141f (diff) | |
download | gcc-c7b6c6cd4791c3003397feea31482c3d19419fe2.zip gcc-c7b6c6cd4791c3003397feea31482c3d19419fe2.tar.gz gcc-c7b6c6cd4791c3003397feea31482c3d19419fe2.tar.bz2 |
builtins.c (expand_builtin): Handle BUILT_IN_INDEX and BUILT_IN_RINDEX.
* builtins.c (expand_builtin): Handle BUILT_IN_INDEX and
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.
From-SVN: r37416
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 68a0e41..68677b5 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -2746,6 +2746,8 @@ expand_builtin (exp, target, subtarget, mode, ignore) || fcode == BUILT_IN_FSQRT || fcode == BUILT_IN_MEMSET || fcode == BUILT_IN_MEMCPY || fcode == BUILT_IN_MEMCMP || fcode == BUILT_IN_BCMP || fcode == BUILT_IN_BZERO + || fcode == BUILT_IN_INDEX || fcode == BUILT_IN_RINDEX + || fcode == BUILT_IN_STRCHR || fcode == BUILT_IN_STRRCHR || fcode == BUILT_IN_STRLEN || fcode == BUILT_IN_STRCPY || fcode == BUILT_IN_STRSTR || fcode == BUILT_IN_STRPBRK || fcode == BUILT_IN_STRCMP || fcode == BUILT_IN_FFS @@ -2888,12 +2890,14 @@ expand_builtin (exp, target, subtarget, mode, ignore) return target; break; + case BUILT_IN_INDEX: case BUILT_IN_STRCHR: target = expand_builtin_strchr (arglist, target, mode); if (target) return target; break; + case BUILT_IN_RINDEX: case BUILT_IN_STRRCHR: target = expand_builtin_strrchr (arglist, target, mode); if (target) |