https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93622

--- Comment #4 from Maxim Egorushkin <maxim.yegorushkin at gmail dot com> ---
I guess you are right, since clang compiles

    bool f(int a, int b) { return a == b; }

into

    f(int, int):
        cmp     edi, esi
        sete    al
        ret

Where sete does't change the 7 high bytes of rax, which creates a false
dependency on the previous value of rax and could reduce performance in some
conditions. A `xor eax, eax` before that `cmp` would fix that.

May be if the ABI required bool to be either 0 or 1 that would allow for
slightly more efficient code, but I don't have numbers to support this claim.

Reply via email to