GNU bug report logs - #13030
factor: infinite loop on Linux/powerpc

Previous Next

Package: coreutils;

Reported by: Colin Watson <cjwatson <at> ubuntu.com>

Date: Thu, 29 Nov 2012 17:51:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Torbjorn Granlund <tg <at> gmplib.org>
Cc: 13030 <at> debbugs.gnu.org, Colin Watson <cjwatson <at> ubuntu.com>, coreutils <at> packages.debian.org
Subject: bug#13030: factor: infinite loop on Linux/powerpc
Date: Thu, 29 Nov 2012 20:08:43 +0000
On 11/29/2012 07:36 PM, Torbjorn Granlund wrote:
> Pádraig Brady <P <at> draigBrady.com> writes:
>
>    > -#if HAVE_HOST_CPU_FAMILY_powerpc && W_TYPE_SIZE == 64
>    > +#if HAVE_HOST_CPU_FAMILY_powerpc && W_TYPE_SIZE == 64 && defined (_LP64)
>    >   #if !defined (_LONG_LONG_LIMB)
>    >   /* _LONG_LONG_LIMB is ABI=mode32 where adde operates on 32-bit values.  So
>    >      use adde etc only when not _LONG_LONG_LIMB.  */
>    >
>    > Thanks,
>    >
>
> I suppose it might be much better to make W_TYPE_SIZE not be set to a
> size not supported by the present ABI.
>
> That way, we will avoid longlong.h divergence.

So that's a bit in contradiction to:
http://bugs.gnu.org/12754#20

So you're suggesting that this would be safest?

diff --git a/src/factor.c b/src/factor.c
index 6d1d17a..d2a4158 100644
--- a/src/factor.c
+++ b/src/factor.c
@@ -126,11 +126,11 @@
 /* Make definitions for longlong.h to make it do what it can do for us */

 /* bitcount for uintmax_t */
-# if UINTMAX_MAX == UINT32_MAX
+# if ULONG_MAX == UINT32_MAX
 #  define W_TYPE_SIZE 32
-# elif UINTMAX_MAX == UINT64_MAX
+# elif ULONG_MAX == UINT64_MAX
 #  define W_TYPE_SIZE 64
-# elif UINTMAX_MAX == UINT128_MAX
+# elif ULONG_MAX == UINT128_MAX
 #  define W_TYPE_SIZE 128
 # endif

In this particular case that would enable
the 32 bit ppc assembly in longlong.h

thanks,
Pádraig.




This bug report was last modified 12 years and 133 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.