Re: [PATCH] strlenopt improvements

2011-11-05 Thread Jakub Jelinek
On Sat, Nov 05, 2011 at 11:44:27AM +0100, Eric Botcazou wrote: > Thanks for the tip. Tested on Solaris 8 and Linux, applied on the mainline. Thanks. > @@ -32,10 +31,9 @@ main () >return 0; > } > > -/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */ > +/* { dg-final { scan

Re: [PATCH] strlenopt improvements

2011-11-05 Thread Eric Botcazou
> The man page is outdated, stpcpy is a standard POSIX2008 function. Sorry for being so 20th century-ish. :-) > Anyway, in the other gcc.dg/strlenopt-* testcases for USE_GNU I was using > the convention that the name ended with g (i.e. strlenopt-22g.c) and > the test would start with: > /* This t

Re: [PATCH] strlenopt improvements

2011-11-02 Thread Jakub Jelinek
On Wed, Nov 02, 2011 at 02:55:54PM +0100, Rainer Orth wrote: > Jakub Jelinek writes: > > > Anyway, in the other gcc.dg/strlenopt-* testcases for USE_GNU I was using > > the convention that the name ended with g (i.e. strlenopt-22g.c) and > > the test would start with: > > /* This test needs runti

Re: [PATCH] strlenopt improvements

2011-11-02 Thread Rainer Orth
Jakub Jelinek writes: > Anyway, in the other gcc.dg/strlenopt-* testcases for USE_GNU I was using > the convention that the name ended with g (i.e. strlenopt-22g.c) and > the test would start with: > /* This test needs runtime that provides stpcpy function. */ > /* { dg-do run { target *-*-linux

Re: [PATCH] strlenopt improvements

2011-11-02 Thread Jakub Jelinek
On Wed, Nov 02, 2011 at 01:41:30PM +0100, Eric Botcazou wrote: > > 2011-10-24 Andreas Krebbel > > > > * gcc.dg/strlenopt-22.c: New testcase. > > This doesn't link if you don't have stpcpy in the libc, e.g. on Solaris. > > Here's an excerpt from the Linux man pages: > > CONFORMING TO >

Re: [PATCH] strlenopt improvements

2011-11-02 Thread Eric Botcazou
> 2011-10-24 Andreas Krebbel > > * gcc.dg/strlenopt-22.c: New testcase. This doesn't link if you don't have stpcpy in the libc, e.g. on Solaris. Here's an excerpt from the Linux man pages: CONFORMING TO This function is not part of the C or POSIX.1 standards, and is not

Re: [PATCH] strlenopt improvements

2011-10-24 Thread Jakub Jelinek
On Mon, Oct 24, 2011 at 10:04:45PM +0200, Andreas Krebbel wrote: > > Can you please explain this stmt_set_p stuff? dont_invalidate should be > > only set on strinfos that will be seen by the immediately following > > maybe_invalidate call (at the end of handle_builtin_strcpy caller - > > strlen_op

Re: [PATCH] strlenopt improvements

2011-10-24 Thread Andreas Krebbel
> Can you please explain this stmt_set_p stuff? dont_invalidate should be > only set on strinfos that will be seen by the immediately following > maybe_invalidate call (at the end of handle_builtin_strcpy caller - > strlen_optimize_stmt). If you set it on which unshare_strinfo is called, > if the

Re: [PATCH] strlenopt improvements

2011-10-24 Thread Jakub Jelinek
On Mon, Oct 24, 2011 at 07:15:14PM +0200, Andreas Krebbel wrote: > + if (dsi->prev != 0 && (chainsi = verify_related_strinfos (dsi)) != > NULL) > + { > + bool stmt_set_p = false; > + > + for (; chainsi && chainsi != dsi; chainsi = get_strinfo > (chainsi->next)) > +

[PATCH] strlenopt improvements

2011-10-24 Thread Andreas Krebbel
Hi, the attached patch fixes all the strlenopt failures on s390x (without nuking the strcat folding). The one case I couldn't get working so far is the second strlen in: __attribute__((noinline, noclone)) size_t bar (char *p, char *q) { char *r; size_t l1, l2; r = strchr (p, '\0'); strc