Open alion02 opened 6 months ago
This seems to be okay on current nightly:
f:
test esi, esi
je .LBB0_2
xor dil, dl
or byte ptr [rcx], 1
.LBB0_2:
movzx eax, dil
and eax, 1
shl eax, 4
or byte ptr [rcx + rax], 1
ret
I tried this code:
It compiles to the following assembly:
The
jmp .LBB0_3
andand dil, 1
instructions are useless, becausedil
is moved toeax
andand
ed with1
there anyway, anddil
is not used anywhere.The output improves if you avoid using
bool
s.godbolt
Meta
rustc --version --verbose
:@rustbot modify labels: -C-bug +C-optimization +A-codegen +A-LLVM +I-slow +I-heavy