https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109476
--- Comment #3 from Wilhelm M ---
Sorry, I forgot to mention the flags: -Os -mmcu=atmega328
Maybe CompilerExplorer ist also usefull:
https://godbolt.org/z/zsq6PT1xb
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109476
Richard Biener changed:
What|Removed |Added
CC||rguenth at gcc dot gnu.org
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109476
--- Comment #1 from Wilhelm M ---
Inetristingly changing the function to
uint16_t mul(const uint8_t a, const uint16_t b) {
return static_cast((b >> 8) + 1) * a ;
}
produces optimal
mul(unsigned char, unsigned int):
subi