This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] strcpy optimizations
On 01/29/13 13:53, OndÅej BÃlka wrote:
> I wanted to use it only to bytes which change.
Sorry, I don't follow.
> There is problem with code like this:
> struct foo {
> long x;
> char y[8];
> long z;
> }
> foo f;
>
> With f.x++; in first thread
> With f.z++; in second thread
> and strcpy (f.y, "abc") in third thread.
The behavior of strcpy is undefined in that case.
So strcpy can do whatever it likes, and
that includes using the pblendvb instruction.