This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to create builtin strncmp
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Patch to create builtin strncmp
- From: Richard Henderson <rth at cygnus dot com>
- Date: Wed, 22 Mar 2000 15:53:23 -0800
- Cc: egcs-patches at egcs dot cygnus dot com
- References: <200003221632.LAA11205@caip.rutgers.edu>
On Wed, Mar 22, 2000 at 11:32:28AM -0500, Kaveh R. Ghazi wrote:
> This patch creates a new builtin strncmp. It operates
> similarly to the strcmp builtin except that it also clamps on the
> third arg (which must be a constant.)
This isn't correct. Yes strncmp clamps the search on the
third argument, but it also stops at '\0'. If you don't
absolutely know the lengths of both strings you can't do
this optimization.
r~