GMP 4.2.4 probably miscompiled by GCC 4.3.2 (debian lenny) on mips64el with -mabi=64: t-divrem_1 and t-fat FAIL

Laurent GUERBY laurent at
Sat Feb 28 21:29:17 CET 2009

On Sat, 2009-02-28 at 21:14 +0100, Torbjorn Granlund wrote:
> I am a little suspicious this is actually not gcc's fault, but a gmp
> bug.  Please try removing mpn/mips64/divrem_1.asm, rerun a clean
> configure, and see if that helps.
> I think mpn/mips64/divrem_1.asm doesn't properly handle both the ABI
> n32 and 64.

Interestingly when I tried to build  -mabi=64 with GCC trunk (4.4) I

/bin/sh ../libtool --mode=compile gcc -mabi=64 -DHAVE_CONFIG_H -I. -I.
-I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo dive_1 | sed 's/_$//'`
-O2 -mabi=64 -c -o dive_1.lo dive_1.c
gcc -mabi=64 -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I..
-DOPERATION_dive_1 -O2 -mabi=64 -c dive_1.c -o dive_1.o
dive_1.c: In function '__gmpn_divexact_1':
dive_1.c:115: error: impossible constraint in 'asm'
dive_1.c:136: error: impossible constraint in 'asm'
make[2]: *** [dive_1.lo] Error 1

GCC 4.3.2 compiles silently...

I'm rerunning a build with mpn/mips64/divrem_1.asm removed
as you indicated (in fact I was looking into the GMP
manual to find a configure flag to disable asm and switch
to a C only version but couldn't find one). I'll let
you know of the result (in about one hour).

Thanks for your help,


More information about the gmp-bugs mailing list