2016-12-06 Jakub Jelinek <jakub@redhat.com>
commit9c104e19e88b8f472b9a4caf8ec099b20e65c082
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Dec 2016 09:23:51 +0000 (6 09:23 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Dec 2016 09:23:51 +0000 (6 09:23 +0000)
tree7a92a285d47f865cf7dc7522c6b591159d6a2013
parent085402d0e60421ef6051d0bc5ea8dae595cb34d0
2016-12-06  Jakub Jelinek  <jakub@redhat.com>

PR c++/71537
* fold-const-call.c (fold_const_call_1): Remove memchr handling here.
(fold_const_call) <case CFN_BUILT_IN_STRNCMP,
case CFN_BUILT_IN_STRNCASECMP>: Formatting improvements.
(fold_const_call) <case CFN_BUILT_IN_MEMCMP>: Likewise.  If s2 is 0
and arguments have no side-effects, return 0.
(fold_const_call): Handle CFN_BUILT_IN_MEMCHR.

* g++.dg/cpp0x/constexpr-memchr.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243285 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/fold-const-call.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-memchr.C [new file with mode: 0644]