This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Readd strchr constant folding (PR c++/71537)


On 12/05/2016 09:54 AM, Jakub Jelinek wrote:
Hi!

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?


jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]