Re: [PATCH] oops_in_progress is unlikely()
From: Jamie Lokier
Date: Wed Sep 10 2003 - 16:55:04 EST
Pavel Machek wrote:
> He's right. Even without subsections you can move code somewhere
> outside the function. And gcc should be smart enough to do that.
It is:
extern int a, b;
int test()
{
if (__builtin_expect(a > 1, 1))
foo();
else
bar();
return b;
}
Compiles to (with gcc -Os -fomit-frame-pointer):
test: cmpl $1, a
jle .L2
call foo
.L3: movl b, %eax
ret
.L2: call bar
jmp .L3
Enjoy,
-- Jamie
-
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/