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.

Do you have write access to the repository?

jeff

Reply via email to