Re: [PATCH] X86-32: Let gcc decide whether to inline memcpy was Re:New x86 warning

From: Linus Torvalds
Date: Wed Apr 22 2009 - 17:26:33 EST




On Wed, 22 Apr 2009, Andi Kleen wrote:
>
> AFAIK it's all true on 3.2+ when it can figure out the alignment
> (but some gcc versions had problems passing the alignment around e.g.
> through inlining), under the assumption that out of line can do
> a better job with unaligned data. That's not true with my patch,
> but could be true in theory.

Maybe it was the unaligned case that I remember.

Because it's definitely not true that out-of-line code can do any better
with unaligned data, at least not for small constants. And the case I
remember was for some silly 8-byte case or similar.

> Quick test here:

How about you just compile the kernel with gcc-3.2 and compare the number
of calls to memcpy before-and-after instead? That's the real test.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/