-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/10/11 09:49, Nick Clifton wrote:
> Hi Guys,
> 
> This is a resend of a previously submitted patch:
> 
> http://gcc.gnu.org/ml/gcc-patches/2009-03/msg00363.html
> 
> This version of the patch has been adjusted to apply to today's
> sources, but otherwise it remains the same.
> 
> The point of the patch is that the cmpstrnsi machine pattern should
> not be used to implement the memcmp builtin function.  This is
> because a string comparison will terminate if two zero bytes are read
> whereas a memory comparison should continue.
> 
> Tested without regressions on i686-pc-linux-gnu and rx-elf
> toolchains.
> 
> OK to apply ?
> 
> Cheers Nick
> 
> gcc/ChangeLog 2011-08-17  Nick Clifton  <ni...@redhat.com>
> 
> * builtins.c (expand_builtin_memcmp): Do not use cmpstrnsi pattern. *
> doc/md.texi (cmpstrn): Note that the comparison stops if both fetched
> bytes are zero. (cmpstr): Likewise. (cmpmem): Note that the
> comparison does not stop if both of the fetched bytes are zero.
OK.  Kindof surprised this wasn't dealt with before.  This sounds soo
much like something I've fixed in the past...

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOQsWZAAoJEBRtltQi2kC7tK0H/1bCmSvyrnDU+pmPo1blJzNo
MGcfo5pHiWnmEDO96HfR0OikLDj63Gu/Fks+c6NuZ+8dFvYCAldIDIprb7+27soi
VIxnGDkXFDJnqOLl7Nri6TW6CWazEPjQtALIcK2a4D+D20ZPlqLao6MIZSzdGdlk
5+giDVZ2sed7XmJYH413R53uTin/TxVCMijYP6smmBydXkdTgjRntNiq/kNBsnEo
v050MH5A5Wiyg4m22FB1vnmL3S4i8Vhq/lZANy/tMzdyO6eyoY36RvBUmBJ9ShAN
QYXrllnqwpzlsAdou5L1TmeBRk0iI9xxn1NkqDkDHo2er5oZTAzqqit0bht0zEw=
=paRW
-----END PGP SIGNATURE-----

Reply via email to