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] Move __builtin_strstr folding from builtins.c to fold-const-call.c + gimple-fold.c; plus a constexpr testcase for strstr


On 12/07/2016 10:30 AM, Jakub Jelinek wrote:
Hi!

As discussed on IRC, this patch adds a constexpr handling testcase for
the strstr builtin and moves it over to the desired files (gimple-fold.c
and fold-const-call.c).

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2016-12-07  Jakub Jelinek  <jakub@redhat.com>

	* 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.
OK.
jeff


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