Re: kernel + gcc 4.1 = several problems
From: Linus Torvalds
Date: Sat Jan 06 2007 - 23:51:46 EST
On Sun, 7 Jan 2007, Denis Vlasenko wrote:
>
> I'd say "care about obvious, safe optimizations which we still not do".
> I want this:
>
> char v[4];
> ...
> memcmp(v, "abcd", 4) == 0
>
> compile to single cmpl on i386.
Yeah. For a more relevant case, look at the hoops we used to jump through
to get "memcpy()" to generate ok code for trivial fixed-sized cases.
(That said, I think __builtin_memcpy() does a reasonable job these days
with gcc, and we might drop the crap one day when we can trust the
compiler to do ok. It didn't use to, and we continued using our
ridiculous macro/__builtin_constant_p misuses just because it works with
_all_ relevant gcc versions).
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/