Re: [PATCH 0/2] strncmp builtin expansion improvement

2016-11-08 Thread Jeff Law
On 11/05/2016 10:32 PM, Aaron Sawdey wrote: On Fri, 2016-11-04 at 20:43 -0600, Jeff Law wrote: So what's the motivation here? When we don't have any constants then I'd think we'd be better off punting into the library. When none of the args to strncmp are constant, I'd be inclined to agree. H

Re: [PATCH 0/2] strncmp builtin expansion improvement

2016-11-07 Thread Aaron Sawdey
On Mon, 2016-11-07 at 15:26 +0100, Richard Biener wrote: > Your patchset doesn't contain a testcase so I really wonder which > case > we know the string length but it is not constant. > > Yes, there's COND_EXPR handling in c_strlen but that should be mostly > dead code -- the real code should be u

Re: [PATCH 0/2] strncmp builtin expansion improvement

2016-11-07 Thread Richard Biener
On Sun, Nov 6, 2016 at 5:32 AM, Aaron Sawdey wrote: > On Fri, 2016-11-04 at 20:43 -0600, Jeff Law wrote: >> So what's the motivation here? When we don't have any constants >> then >> I'd think we'd be better off punting into the library. > > When none of the args to strncmp are constant, I'd be i

Re: [PATCH 0/2] strncmp builtin expansion improvement

2016-11-05 Thread Aaron Sawdey
On Fri, 2016-11-04 at 20:43 -0600, Jeff Law wrote: > So what's the motivation here?  When we don't have any constants > then  > I'd think we'd be better off punting into the library. When none of the args to strncmp are constant, I'd be inclined to agree. However the current state of affairs is th

Re: [PATCH 0/2] strncmp builtin expansion improvement

2016-11-05 Thread Jeff Law
On 11/01/2016 04:29 PM, Aaron Sawdey wrote: Builtin expansion of strncmp currently only happens when at least one of the string arguments is a constant string. I'd like to make it also attempt expansion of the cmpstrnsi pattern in the case where neither argument is a constant string, as is alread

[PATCH 0/2] strncmp builtin expansion improvement

2016-11-01 Thread Aaron Sawdey
Builtin expansion of strncmp currently only happens when at least one of the string arguments is a constant string. I'd like to make it also attempt expansion of the cmpstrnsi pattern in the case where neither argument is a constant string, as is already done with cmpstrsi in expand_builtin_strcmp.