Re: [PATCH 2/3] Fold __builtin_memchr (version 2)

2016-10-10 Thread Martin Liška
On 10/10/2016 01:28 PM, Wilco Dijkstra wrote: > Martin Liška wrote: >> On 10/07/2016 01:21 PM, Wilco Dijkstra wrote: >> >>> 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

Re: [PATCH 2/3] Fold __builtin_memchr (version 2)

2016-10-10 Thread Wilco Dijkstra
Martin Liška wrote: > On 10/07/2016 01:21 PM, Wilco Dijkstra wrote: > > > 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

Re: [PATCH 2/3] Fold __builtin_memchr (version 2)

2016-10-10 Thread Martin Liška
On 10/07/2016 01:21 PM, Wilco Dijkstra wrote: > Hi, > >> -static int >> +int >> target_char_cast (tree cst, char *p) > >> + if (target_char_cast (arg2, )) >> +return false; > > I believe target_char_cast is incorrect if the host/target chars are not > identical > (depending on how

Re: [PATCH 2/3] Fold __builtin_memchr (version 2)

2016-10-07 Thread Wilco Dijkstra
Hi, > -static int > +int > target_char_cast (tree cst, char *p) > + if (target_char_cast (arg2, )) > + 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

Re: [PATCH 2/3] Fold __builtin_memchr (version 2)

2016-10-07 Thread Richard Biener
On Fri, Oct 7, 2016 at 10:41 AM, Martin Liška wrote: > Resending the patch, where I implemented folding in gimple-fold.c > > Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. +/* Fold a call to the str{n}{case}cmp builtin pointed by GSI iterator. +

[PATCH 2/3] Fold __builtin_memchr (version 2)

2016-10-07 Thread Martin Liška
Resending the patch, where I implemented folding in gimple-fold.c Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Ready to be installed? Martin >From d4c1257b092f245a52386e305391d1e46e2ef088 Mon Sep 17 00:00:00 2001 From: marxin Date: Thu, 6 Oct 2016