When x has bit 63 set, then the unsigned integer division x/x will give 0 instead of 1. This is due to a typo in __divqu. The same problem exists in __remqu. This breaks gmp (see http://bugs.debian.org/324455). The attached patch fixes it. This patch has been in use in Debian's glibc for a while.
Created attachment 721 [details] patch
The patch is correct. I asked Falk to open the PR for Roland and the 2.3 branch.
Fixed on the trunk. Possibly for the 2.3 branch.
Subject: Bug 1498 CVSROOT: /cvs/glibc Module name: libc Branch: glibc-2_3-branch Changes by: roland@sources.redhat.com 2005-10-23 00:52:00 Modified files: sysdeps/alpha : divqu.S remqu.S Log message: 2005-08-23 GOTO Masanori <gotom@debian.or.jp> [BZ #1498] * sysdeps/alpha/remqu.S: Return the correct result when the same dividend and divisor are provided, and they're negative numbers. * sysdeps/alpha/divqu.S: Likewise. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/alpha/divqu.S.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.8&r2=1.8.4.1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/alpha/remqu.S.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.10&r2=1.10.4.1
Thanks for your catching up to apply the patch.
This bug should be fixed in the 2.3.6 release just made.