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

View: New views
7 Messages — Rating Filter:   Alert me  

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

by Laurent GUERBY :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Here is the details of what I did:

guerby@gcc51:~/gmp-4.2.4$ uname -a
Linux gcc51 2.6.27.1-libre-medan #1 PREEMPT Thu Feb 12 08:21:37 CST 2009 mips64 GNU/Linux
guerby@gcc51:~/gmp-4.2.4$ gcc -v
Using built-in specs.
Target: mipsel-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1.1' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --disable-libssp --enable-checking=release --build=mipsel-linux-gnu --host=mipsel-linux-gnu --target=mipsel-linux-gnu
Thread model: posix
gcc version 4.3.2 (Debian 4.3.2-1.1)
guerby@gcc51:~/gmp-4.2.4$ echo $CC
gcc -mabi=64
guerby@gcc51:~/gmp-4.2.4$ ./configure --prefix=/opt/cfarm/gmp-4.2.4-64-b --disable-nls --disable-shared
...
make
...
make check
...
make[4]: Entering directory `/home/guerby/gmp-4.2.4/tests/mpn'
PASS: t-asmtype
PASS: t-aors_1
/bin/sh: line 4: 25983 Segmentation fault      ${dir}$tst
FAIL: t-divrem_1
/bin/sh: line 4: 25988 Bus error               ${dir}$tst
FAIL: t-fat
PASS: t-get_d
PASS: t-instrument
PASS: t-iord_u
PASS: t-mp_bases
PASS: t-perfsqr
PASS: t-scan
==================================
2 of 10 tests failed
Please report to gmp-bugs@...
==================================

I tried to build GCC 4.4 with -mabi=64 on mips64el but found it blew
up in GMP __gmpn_divrem_1 so the make check is catching a significant
issue.

Torbjorn, the machine I'm using is part of the farm but I haven't
created all accounts on it yet. I have added your public key
to my account which was used to produce the above, to connect
the following should work for you:

ssh -p 9081 guerby@...

Feel free to play in /home/guerby/gmp-4.2.4 or to
create /home/guerby/tege and work there, I used
the compiler in PATH from debian (/usr/bin/gcc).

A 64 bits gdb is available: /opt/cfarm/gdb-6.8-64/bin/gdb
gmp-4.2.4.tar.bz2 is in /opt/cfarm/ftp

Let me know if you need anything else,

Sincerely,

Laurent
http://gcc.gnu.org/wiki/CompileFarm


_______________________________________________
gmp-bugs mailing list
gmp-bugs@...
http://gmplib.org/mailman/listinfo/gmp-bugs

Parent Message unknown Re: 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

by Laurent GUERBY :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
got:

/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,

Laurent

_______________________________________________
gmp-bugs mailing list
gmp-bugs@...
http://gmplib.org/mailman/listinfo/gmp-bugs

Re: 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

by Torbjorn Granlund-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

The file is gone in GMP 4.3 (due out RSN).

--
Torbjörn
_______________________________________________
gmp-bugs mailing list
gmp-bugs@...
http://gmplib.org/mailman/listinfo/gmp-bugs

Re: 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

by Torbjorn Granlund-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Laurent GUERBY <laurent@...> writes:

  Interestingly when I tried to build  -mabi=64 with GCC trunk (4.4) I
  got:
 
  /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

Apparelntly, the "h" register constraint was removed in 4.4, for
unclear reasons.  See http://gcc.gnu.org/gcc-4.4/changes.html.

--
Torbjörn
_______________________________________________
gmp-bugs mailing list
gmp-bugs@...
http://gmplib.org/mailman/listinfo/gmp-bugs

Parent Message unknown Re: 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

by Laurent GUERBY :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

With the removal of this file all test PASS.

Let me know if you want me to try something else.

Thanks for your help,

Laurent

_______________________________________________
gmp-bugs mailing list
gmp-bugs@...
http://gmplib.org/mailman/listinfo/gmp-bugs

Re: 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

by Torbjorn Granlund-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Laurent GUERBY <laurent@...> writes:

  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.
 
  With the removal of this file all test PASS.
 
Thanks for reporting, thanks for following up!

  Let me know if you want me to try something else.

I'll make sure GMP 4.3 works for the platform, even with the pesky GCC
4.4.  (I intend to make the gcc compile farm machines run gmp
automated builds.)

--
Torbjörn
_______________________________________________
gmp-bugs mailing list
gmp-bugs@...
http://gmplib.org/mailman/listinfo/gmp-bugs

Re: 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

by Laurent GUERBY :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 2009-02-28 at 21:47 +0100, Torbjorn Granlund wrote:

> Laurent GUERBY <laurent@...> writes:
>
>   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.
>  
>   With the removal of this file all test PASS.
>  
> Thanks for reporting, thanks for following up!
>
>   Let me know if you want me to try something else.
>
> I'll make sure GMP 4.3 works for the platform, even with the pesky GCC
> 4.4.  (I intend to make the gcc compile farm machines run gmp
> automated builds.)

Great! I will probably create all accounts monday on gcc51
and send the announce (gcc52 the other mips64el machine of the farm has
only 32 bits compiler and libraries).

Sincerely,

Laurent


_______________________________________________
gmp-bugs mailing list
gmp-bugs@...
http://gmplib.org/mailman/listinfo/gmp-bugs