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

yuki.tanaka at defaultcase dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yuki.tanaka at defaultcase dot 
de

--- Comment #5 from yuki.tanaka at defaultcase dot de ---
Same on arm and riscv32 at -Os:

unsigned a(unsigned x, unsigned y)
{
  return ((unsigned long long) x * y) >> 32;
}

Compiler Explorer (arm and riscv32, GCC 16.1 vs. 17):

arm -Os -mcpu=cortex-m0 -mfloat-abi=soft: GCC 16.1 calls __aeabi_lmul, GCC 17
expands it inline.

riscv32 -Os -march=rv32i -mabi=ilp32: GCC 16.1 calls __muldi3 once, GCC 17
calls __mulsi3 four times, so there is still a libcall and the inline expansion
only adds code.

On rv32i this also happens at -O2 (four __mulsi3 calls instead of one
__muldi3).

Reply via email to