Re: RFC: booleans and the kernel

Robert Love
2002-01-24T22:09:02Z

On Thu, 2002-01-24 at 16:55, Richard B. Johnson wrote:

> Don't you wish!
> [snip]
> cmpl $0,8(%ebp) <-------------- Compare against zero.

Ah, but you compiled without optimization. Using your example program,
`gcc -Wall -S example.c' gives me the same output as you. But with -O2
I get:

foo:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %edx
xorl %eax, %eax
testl %edx, %edx
sete %al
popl %ebp
ret

Which is the XOR and self-test with no constant Oliver described.

Robert Love