Fold __builtin_str{n}{case}cmp functions
authorMartin Liska <mliska@suse.cz>
Fri, 14 Oct 2016 12:08:27 +0000 (14:08 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 14 Oct 2016 12:08:27 +0000 (12:08 +0000)
commita918bfbf3c5b686362f3f97314c2b4bf142d2f82
treec896ce6d1d5d5cec3b0369bdda9ddacf3ad4f63f
parentace4c2f060160bd3ef9032cc151e36b84e4ba3e8
Fold __builtin_str{n}{case}cmp functions

* builtins.c (fold_builtin_strcmp): Remove function.
(fold_builtin_strncmp): Likewise.
(fold_builtin_2): Remove call of the function.
(fold_builtin_3): Likewise.
* fold-const-call.c (fold_const_call): Add constant folding
for CFN_BUILT_IN_STRCASECMP and CFN_BUILT_IN_STRNCASECMP.
* fold-const-call.h (build_cmp_result): Declare the function.
* gimple-fold.c (gimple_load_first_char): New function.
(gimple_fold_builtin_string_compare): Likewise.
(gimple_fold_builtin): Call the function.

From-SVN: r241159
gcc/ChangeLog
gcc/builtins.c
gcc/fold-const-call.c
gcc/fold-const-call.h
gcc/gimple-fold.c