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

Franek Korta <fkorta at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fkorta at gmail dot com

--- Comment #9 from Franek Korta <fkorta at gmail dot com> ---
Another simple example:
#include <cstdint>

struct SomeClass {
    bool         cfg1 : 1;
    bool         cfg2 : 1;
    bool         cfg3 : 1;
    bool check() const noexcept { return cfg1 || cfg2 || cfg3; }
};

bool check(const SomeClass& rt) {
    return rt.check();
}

Emits:
check(SomeClass const&):
        movzx   edx, BYTE PTR [rdi]
        mov     eax, edx
        and     eax, 1
        jne     .L1
        mov     eax, edx
        shr     al
        and     eax, 1
        je      .L4
.L1:
        ret
.L4:
        mov     eax, edx
        shr     al, 2
        and     eax, 1
        ret

While it should:
check(SomeClass const&):
        test    byte ptr [rdi], 7
        setne   al
        ret

Reply via email to