On 11/16/2017 06:53 PM, Qing Zhao wrote:
> 
>> On Nov 16, 2017, at 6:57 PM, Jeff Law <l...@redhat.com
>> <mailto:l...@redhat.com>> wrote:
>>
>> On 11/15/2017 08:00 AM, Qing Zhao wrote:
>>> Hi,
>>>
>>> this is the first patch for PR78809 (totally 3 patches)
>>>
>>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78809
>>> inline strcmp with small constant strings
>>>
>>> The design doc is at:
>>> https://www.mail-archive.com/gcc@gcc.gnu.org/msg83822.html
>>>
>>> this patch is for the first part of change:
>>>
>>> A. for strncmp (s1, s2, n)
>>>     if one of "s1" or "s2" is a constant string, "n" is a constant, and
>>> larger than the length of the constant string:
>>>     change strncmp (s1, s2, n) to strcmp (s1, s2);
>>>
>>> adding test case strcmpopt_1.c into gcc.dg
>>>
>>> bootstraped and tested on both X86 and aarch64. no regression.
>>>
>>> Okay for commit?
>>>
>>> thanks.
>>>
>>> Qing
>>>
>>> ======================
>>>
>>> gcc/ChangeLog
>>>
>>> 2017-11-15  Qing Zhao  <qing.z...@oracle.com>
>>>
>>>       * gimple-fold.c (gimple_fold_builtin_string_compare): Add handling
>>>       of replacing call to strncmp with corresponding call to strcmp when
>>>       meeting conditions.
>>>
>>> gcc/testsuite/ChangeLog
>>>
>>> 2017-11-15  Qing Zhao  <qing.z...@oracle.com>
>>>
>>>       PR middle-end/78809
>>>       * gcc.dg/strcmpopt_1.c: New test.
>> This is OK for the trunk.
>>
>> Please put the PR middle-end/78809 marker in the main ChangeLog entry as
>> well.
> 
> Okay.  (as following?)
> 
> 2017-11-15  Qing Zhao <qing.z...@oracle.com <mailto:qing.z...@oracle.com>>
> 
>         PR middle-end/78809
>         * gimple-fold.c (gimple_fold_builtin_string_compare): Add handling
>         of replacing call to strncmp with corresponding call to strcmp when
>         meeting conditions.
> 
> 
> gcc/testsuite/ChangeLog
> 
> 2017-11-15  Qing Zhao  <qing.z...@oracle.com <mailto:qing.z...@oracle.com>>
> 
>       PR middle-end/78809
>       * gcc.dg/strcmpopt_1.c: New test.
> 
>>
>> Do you have write access to the repository?
> 
> No, I don’t have. 
OK.  I'll go ahead and commit for you.

I think this patch is small enough to not require a copyright
assignment.  However further work likely will.  I don't offhand know if
Oracle has a blanket assignment in place.  Can you work with Paolo to
ensure that the proper paperwork is in place so that future
contributions don't get held up on legal stuff.



Thanks,
jeff

Reply via email to