Re: [PATCH, bugfix] builtin expansion of strcmp for rs6000

2017-01-17 Thread Aaron Sawdey
On Tue, 2017-01-17 at 08:30 -0600, Peter Bergner wrote: > On 1/16/17 3:09 PM, Aaron Sawdey wrote: > > Here is an updated version of this patch. > > > > Tulio noted that glibc's strncmp test was failing. This turned out > > to > > be the use of signed HOST_WIDE_INT for handling strncmp length. The

Re: [PATCH, bugfix] builtin expansion of strcmp for rs6000

2017-01-17 Thread Peter Bergner
On 1/16/17 3:09 PM, Aaron Sawdey wrote: Here is an updated version of this patch. Tulio noted that glibc's strncmp test was failing. This turned out to be the use of signed HOST_WIDE_INT for handling strncmp length. The glibc test calls strncmp with length 2^64-1, presumably to provoke exactly t

Re: [PATCH, bugfix] builtin expansion of strcmp for rs6000

2017-01-16 Thread Segher Boessenkool
On Mon, Jan 16, 2017 at 03:09:35PM -0600, Aaron Sawdey wrote: > Tulio noted that glibc's strncmp test was failing. This turned out to > be the use of signed HOST_WIDE_INT for handling strncmp length. The > glibc test calls strncmp with length 2^64-1, presumably to provoke > exactly this type of bug

Re: [PATCH, bugfix] builtin expansion of strcmp for rs6000

2017-01-16 Thread Aaron Sawdey
Here is an updated version of this patch.  Tulio noted that glibc's strncmp test was failing. This turned out to be the use of signed HOST_WIDE_INT for handling strncmp length. The glibc test calls strncmp with length 2^64-1, presumably to provoke exactly this type of bug. Fixing the issue require

[PATCH, bugfix] builtin expansion of strcmp for rs6000

2017-01-11 Thread Aaron Sawdey
This expands on the previous patch. For strcmp and for strncmp with N larger than 64, the first 64 bytes of comparison is expanded inline and then a call to strcmp or strncmp is emitted to compare the remainder if the strings are found to be equal at that point.  -mstring-compare-inline-limit=N de