Re: [PATCH v2 1/2, i386] cmpstrnsi needs string length

2016-11-17 Thread Uros Bizjak
On Wed, Nov 16, 2016 at 8:22 PM, Aaron Sawdey wrote: > This patch adds a test to the cmpstrnsi pattern in i386.md so that it > will bail out (FAIL) if neither of the strings is a constant string. It > can only work as a proper strncmp if the length is not longer than both > of the strings. This ch

Re: [PATCH v2 1/2, i386] cmpstrnsi needs string length

2016-11-17 Thread Bernd Schmidt
On 11/16/2016 08:22 PM, Aaron Sawdey wrote: I've also changed the pattern to indicate that operand 3 may be clobbered (if it happens to be in cx already). That part looks like a meaningless change since the pattern in that define_expand is never used (there's a DONE at the end). I don't thin

[PATCH v2 1/2, i386] cmpstrnsi needs string length

2016-11-16 Thread Aaron Sawdey
This patch adds a test to the cmpstrnsi pattern in i386.md so that it will bail out (FAIL) if neither of the strings is a constant string. It can only work as a proper strncmp if the length is not longer than both of the strings. This change is required if expand_builtin_strncmp is going to try exp