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]
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
Module name: libc
Changes by: firstname.lastname@example.org 2005-10-23 00:52:00
sysdeps/alpha : divqu.S remqu.S
2005-08-23 GOTO Masanori <email@example.com>
* 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.
Thanks for your catching up to apply the patch.
This bug should be fixed in the 2.3.6 release just made.