factor: fix infinite loop on 32 bit powerpc
commit7d034663e4671be6fe8b8eacf88fb5edc42ea0c0
authorColin Watson <cjwatson@ubuntu.com>
Thu, 29 Nov 2012 19:37:30 +0000 (29 19:37 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 4 Dec 2012 12:28:42 +0000 (4 12:28 +0000)
treedbf95b26b0b30a797e6dc0af42bb7fa3c90bff5b
parent06aeeecb3fe2655fd5e4e12948b389873a79884b
factor: fix infinite loop on 32 bit powerpc

Both Debian and Ubuntu builds of coreutils 8.20 hang while running the
test suite on powerpc, which is reproducible using 'factor 122'.

This turns out to be somewhat related to http://bugs.gnu.org/12754,
but not quite the same.  uintmax_t is 64 bits, but the cntlzw
instruction takes 32-bit operands, and the cntlzd option is only
available on 64-bit hardware.

* src/longlong.h: Add an _LP64 check around the PPC64 code,
so that this falls back to the C implementations.
* NEWS: Mention the fix.
NEWS
src/longlong.h