https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105477
--- Comment #3 from Dimitar Dimitrov <dimitar at gcc dot gnu.org> ---
Commit r15-1579-g792f97b44ffc5e improves the generated code:
test:
bne a2,zero,.L2
mv a1,a0
.L2:
mv a0,a1
ret