public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Better folding of 2 string builtin-ins
@ 2016-08-17  6:55 marxin
  2016-08-17  6:55 ` [PATCH 3/3] Test folding of strn{case}cmp and memchr marxin
                   ` (3 more replies)
  0 siblings, 4 replies; 49+ messages in thread
From: marxin @ 2016-08-17  6:55 UTC (permalink / raw)
  To: gcc-patches

Hi.

During playing with -fprofile-values I've noticed that some builtins
are not folded ideally. Fixing in attached mini patch series.

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed?
Martin

marxin (3):
  Fold BUILT_IN_STRNCASECMP
  Smarter folding of __builtin_memchr
  Test folding of strn{case}cmp and memchr

 gcc/builtins.c                                   | 39 ++++++++++++----
 gcc/testsuite/gcc.dg/tree-ssa/builtins-folding.c | 59 ++++++++++++++++++++++++
 2 files changed, 88 insertions(+), 10 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/builtins-folding.c

-- 
2.9.2

^ permalink raw reply	[flat|nested] 49+ messages in thread
* Re: [PATCH 2/3] Fold __builtin_memchr (version 2)
@ 2016-10-07 11:21 Wilco Dijkstra
  2016-10-10 10:57 ` Martin Liška
  0 siblings, 1 reply; 49+ messages in thread
From: Wilco Dijkstra @ 2016-10-07 11:21 UTC (permalink / raw)
  To: mliska; +Cc: GCC Patches, nd

Hi,

> -static int
> +int
> target_char_cast (tree cst, char *p)

> +      if (target_char_cast (arg2, &c))
> +	return false;

I believe target_char_cast is incorrect if the host/target chars are not identical
(depending on how constant strings are created there may be signed/unsigned
mismatches too). I recently added target_char_cst_p to gimple-fold.c to avoid
char representation mismatches, so it would be better to use that instead.

Wilco

^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2016-10-14 11:58 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-17  6:55 [PATCH 0/3] Better folding of 2 string builtin-ins marxin
2016-08-17  6:55 ` [PATCH 3/3] Test folding of strn{case}cmp and memchr marxin
2016-08-17  7:52   ` Martin Liška
2016-10-07  8:42     ` [PATCH 3/3] Test folding of str{n}{case}cmp and memchr (version 2) Martin Liška
2016-10-11  9:39       ` [PATCH] Test folding of str{n}{case}cmp and memchr (version 3) Martin Liška
2016-10-12  8:35         ` Richard Biener
2016-10-12 13:20           ` Martin Liška
2016-10-13 15:27             ` [PATCH] Test folding of str{n}{case}cmp and memchr (simplified version 4) Martin Liška
2016-10-14 11:58               ` Richard Biener
2016-08-17  6:55 ` [PATCH 1/3] Fold BUILT_IN_STRNCASECMP marxin
2016-08-17  7:10   ` Jakub Jelinek
2016-08-17  7:52     ` Martin Liška
2016-10-07  8:39   ` [PATCH 1/3] Fold __builtin_str{n}{case}cmp functions (version 2) Martin Liška
2016-10-07 10:50     ` Richard Biener
2016-10-11  9:26       ` Martin Liška
2016-10-11 10:27         ` Richard Biener
2016-10-11  9:28       ` [PATCH] Check \0-termination of string in c_getstr Martin Liška
2016-10-11 10:28         ` Richard Biener
2016-10-12 13:14           ` Martin Liška
2016-10-13 15:24             ` [PATCH] Check \0-termination of string in c_getstr (simplified version) Martin Liška
2016-10-14  9:38               ` Richard Biener
2016-10-14 11:10                 ` Martin Liška
2016-10-11  9:28       ` [PATCH] Add a helper function: create_tmp Martin Liška
2016-10-11 10:30         ` Richard Biener
2016-10-11 10:31           ` Richard Biener
2016-10-12 10:50             ` Martin Liška
2016-10-11  9:34       ` [PATCH] Fold __builtin_str{n}{case}cmp functions (version 3) Martin Liška
2016-10-12  8:30         ` Richard Biener
2016-10-12 13:17           ` Martin Liška
2016-10-13 15:25             ` [PATCH] Fold __builtin_str{n}{case}cmp functions (simplified version 4) Martin Liška
2016-10-14 11:55               ` Richard Biener
2016-08-17  6:55 ` [PATCH 2/3] Smarter folding of __builtin_memchr marxin
2016-08-17  8:41   ` Richard Biener
2016-10-07  8:41     ` [PATCH 2/3] Fold __builtin_memchr (version 2) Martin Liška
2016-10-07 11:01       ` Richard Biener
2016-10-11  9:38         ` [PATCH] Fold __builtin_memchr (version 3) Martin Liška
2016-10-12  8:34           ` Richard Biener
2016-10-12  8:36           ` Richard Biener
2016-10-12 13:19             ` Martin Liška
2016-10-13 15:26               ` [PATCH] Fold __builtin_memchr (simplified version 4) Martin Liška
2016-10-14 11:57                 ` Richard Biener
2016-10-12 13:48 ` [RFC] Possible folding opportunities for string built-ins Martin Liška
2016-10-12 15:55   ` Joseph Myers
2016-10-12 19:45     ` Jim Wilson
2016-10-13  8:38   ` Richard Biener
2016-10-07 11:21 [PATCH 2/3] Fold __builtin_memchr (version 2) Wilco Dijkstra
2016-10-10 10:57 ` Martin Liška
2016-10-10 11:28   ` Wilco Dijkstra
2016-10-10 11:37     ` Martin Liška

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).