This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Readd strchr constant folding (PR c++/71537)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Richard Biener <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 5 Dec 2016 18:59:14 +0100
- Subject: Re: [PATCH] Readd strchr constant folding (PR c++/71537)
- Authentication-results: sourceware.org; auth=none
- References: <20161205165448.GO3541@tucnak.redhat.com> <dcdf623c-1fc5-4c5c-d7b2-d69969a9afe0@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Dec 05, 2016 at 10:55:05AM -0700, Jeff Law wrote:
> On 12/05/2016 09:54 AM, Jakub Jelinek wrote:
> >The recent changes to move strchr folding from builtins.c to gimple-fold.c
> >broke constexpr handling with __builtin_strchr etc. (which the libstdc++
> >folks want to use).
> >
> >Fixed by handling it also in fold-const-call.c. Bootstrapped/regtested on
> >x86_64-linux and i686-linux, ok for trunk?
> >
> >2016-12-05 Jakub Jelinek <jakub@redhat.com>
> >
> > PR c++/71537
> > * fold-const-call.c (fold_const_call): Handle
> > CFN_BUILT_IN_{INDEX,STRCHR,RINDEX,STRRCHR}.
> >
> > * g++.dg/cpp0x/constexpr-strchr.C: New test.
> Thoughts on moving this into match.pd? I don't see any string builtins
> there, so perhaps leave it in fold-const-call for now, then move them as a
> group later?
At least my understanding has been that such stuff goes into
fold-const-call.c in the new world. The GIMPLE optimizers for these functions
have also been added to gimple-fold.c, not to match.pd.
Jakub