This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r262636 - in /trunk/gcc: ChangeLog builtins.c d...
- From: qinzhao at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Fri, 13 Jul 2018 14:10:46 -0000
- Subject: r262636 - in /trunk/gcc: ChangeLog builtins.c d...
Author: qinzhao
Date: Fri Jul 13 14:10:45 2018
New Revision: 262636
URL: https://gcc.gnu.org/viewcvs?rev=262636&root=gcc&view=rev
Log:
3nd Patch for PR78009
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78809
Inline strcmp with small constant strings
The design doc for PR78809 is at:
https://www.mail-archive.com/gcc@gcc.gnu.org/msg83822.html
this patch is for the third part of change of PR78809.
C. for strcmp (s1, s2), strncmp (s1, s2, n), and memcmp (s1, s2, n)
if the result is NOT used to do simple equality test against zero, one of
"s1" or "s2" is a small constant string, n is a constant, and the Min value of
the length of the constant string and "n" is smaller than a predefined
threshold T,
inline the call by a byte-to-byte comparision sequence to avoid calling
overhead.
adding test case strcmpopt_5.c into gcc.dg for part C of PR78809.
adding test case strcmpopt_6.c into gcc.dg to test the following case:
When the specified length exceeds one of the arguments of the call to memcmp,
the call to memcmp should NOT be inlined.
Added:
trunk/gcc/testsuite/gcc.dg/strcmpopt_5.c
trunk/gcc/testsuite/gcc.dg/strcmpopt_6.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/builtins.c
trunk/gcc/doc/invoke.texi
trunk/gcc/params.def
trunk/gcc/testsuite/ChangeLog