On Sun, 21 Oct 2007 16:02:15 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
I'm not debating that. What I'm saying is that calling memcpy() casts your =
pointers to void* with the included semantical changes. It can't just ignor=
e that because it decides to inline the function. It would be the same thin=
g as when gcc decided to ignore the volatile qualifier on a pointer just be=
cause it could optimize away to the real object and discover it wasn't mark=
ed with volatile. Something that was considered a bug and was fixed.
gcc has had bugs in the past.
I assume those ops cause a bus error on unaligned addresses?
It wouldn't be magic:
memcpy(&icmp_param.data.icmph, skb_transport_header(skb), sizeof(struct icm=
phdr));
I believe platforms without alignment requirements could optimize this bett=
er than the series of assignments. Not that I think this will be a potentia=
l bottle neck, but still.
Indeed.
Rgds
Pierre