Re: [PATCH] MIPS: Fix the GCC version check for `__multi3' workaround

From: Thomas Bogendoerfer

Date: Wed Apr 01 2026 - 16:34:33 EST


On Mon, Mar 30, 2026 at 02:54:09AM +0100, Maciej W. Rozycki wrote:
> It was only GCC 10 that fixed a MIPS64r6 code generation issue with a
> `__multi3' libcall inefficiently produced to perform 64-bit widening
> multiplication while suitable machine instructions exist to do such a
> calculation. The fix went in with GCC commit 48b2123f6336 ("re PR
> target/82981 (unnecessary __multi3 call for mips64r6 linux kernel)").
>
> Adjust our code accordingly, removing build failures such as:
>
> mips64-linux-ld: lib/math/div64.o: in function `mul_u64_add_u64_div_u64':
> div64.c:(.text+0x84): undefined reference to `__multi3'
>
> with the GCC versions affected.
>
> Fixes: ebabcf17bcd7 ("MIPS: Implement __multi3 for GCC7 MIPS64r6 builds")
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202601140146.hMLODc6v-lkp@xxxxxxxxx/
> Signed-off-by: Maciej W. Rozycki <macro@xxxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx # v4.15+
> ---
> arch/mips/lib/multi3.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)

applied to mips-fixes

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]