builtins.c (fold_builtin_strstr): Removed.
authorJakub Jelinek <jakub@redhat.com>
Wed, 7 Dec 2016 19:45:45 +0000 (20:45 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 7 Dec 2016 19:45:45 +0000 (20:45 +0100)
commitc89529306c91eafa81c762e9050d51c747c14af0
treebd3017b456fa1faec07937e6000fdcee0fa4895e
parent77f1efdbe8fe401040adb9b2b43aac85916682ac
builtins.c (fold_builtin_strstr): Removed.

* builtins.c (fold_builtin_strstr): Removed.
(fold_builtin_2): Don't call fold_builtin_strstr.
* gimple-fold.c (gimple_fold_builtin_strchr): Check is_strrchr
earlier in the strrchr (x, 0) -> strchr (x, 0) optimization.
(gimple_fold_builtin_strstr): New function.
(gimple_fold_builtin): Call it.
* fold-const-call.c (fold_const_call): Handle CFN_BUILT_IN_STRSTR.

* gcc.dg/builtin-strstr-1.c: New test.
* g++.dg/cpp0x/constexpr-strstr.C: New test.

From-SVN: r243378
gcc/ChangeLog
gcc/builtins.c
gcc/fold-const-call.c
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-strstr.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/builtin-strstr-1.c [new file with mode: 0644]