Hi Bill, the following testcase shows another problem:
struct A
{
int a[1024];
};
void g(struct A *a, struct A *b)
{
*a = *b;
}
struct A c;
int main(void)
{
g(&c, &c);
}
Note that llvm-gcc generates a memcpy for the *a = *b
assignment, but it should be memmove since *a and *b
may be the same (as they are in this case).
Ciao,
Duncan.
PS: on some machines memcpy goes faster if you zero out
the destination before doing the copy. This shows why
doing a memcpy of p to p is a bad idea!
_______________________________________________
llvm-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits