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

--- Comment #1 from Wilhelm M <klaus.doldinger64 at googlemail dot com> ---
Inetristingly changing the function to 


uint16_t mul(const uint8_t a, const uint16_t b) {
    return static_cast<uint8_t>((b >> 8) + 1) * a ;
}

produces optimal

mul(unsigned char, unsigned int):
        subi r23,lo8(-(1))
        mul r23,r24
        movw r24,r0
        clr __zero_reg__
        ret

Reply via email to