This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/3][middle-end]PR78809 (Inline strcmp with small constant strings)
- From: Qing Zhao <qing dot zhao at oracle dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Wilco Dijkstra <wilco dot dijkstra at arm dot com>, Richard Biener <rguenther at suse dot de>, richard Earnshaw <richard dot earnshaw at arm dot com>
- Date: Thu, 16 Nov 2017 19:53:00 -0600
- Subject: Re: [PATCH 1/3][middle-end]PR78809 (Inline strcmp with small constant strings)
- Authentication-results: sourceware.org; auth=none
- References: <DFBEFF33-8012-4631-9117-52E82C68545E@oracle.com> <c4de390b-a1ab-6fe7-9999-a617ae59ab88@redhat.com>
> On Nov 16, 2017, at 6:57 PM, Jeff Law <law@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.zhao@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.zhao@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.zhao@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.zhao@oracle.com <mailto:qing.zhao@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.
Qing
>
> jeff