Re: RFC: booleans and the kernel

From: Robert Love (rml@tech9.net)
Date: Thu Jan 24 2002 - 17:13:05 EST


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

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



This archive was generated by hypermail 2b29 : Thu Jan 31 2002 - 21:00:25 EST