Subject: bug#12754: closed (Re: bug#12754: factor.c selects 64 bit code from longlong.h on 32-bit hppa systems)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 04 Nov 2012 00:58:02 +0000

Your bug report

#12754: factor.c selects 64 bit code from longlong.h on 32-bit hppa systems

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
12754: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12754
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#12754: factor.c selects 64 bit code from longlong.h on 32-bit hppa systems
From: Pádraig Brady <[email-masked]>
To: Torbjorn Granlund <[email-masked]>
Cc: [email-masked], John David Anglin <[email-masked]>, John David Anglin <[email-masked]>
Date: Sun, 04 Nov 2012 00:54:09 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

On 10/30/2012 01:59 AM, Pádraig Brady wrote:
> Since 2.0 is the only arch that supports the 64 bit hppa code in longlong.h,
> the following enables the code to compile by default.
>
> diff --git a/src/longlong.h b/src/longlong.h
> index 8d71611..8b01696 100644
> --- a/src/longlong.h
> +++ b/src/longlong.h
> @@ -679,7 +679,7 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
>   /* These macros are for ABI=2.0w.  In ABI=2.0n they can't be used, since GCC
>      (3.2) puts longlong into two adjacent 32-bit registers.  Presumably this
>      is just a case of no direct support for 2.0n but treating it like 1.0. */
> -#if defined (__hppa) && W_TYPE_SIZE == 64 && ! defined (_LONG_LONG_LIMB)
> +#if defined (__hppa) && defined (_PA_RISC2_0) && W_TYPE_SIZE == 64 && ! defined (_LONG_LONG_LIMB)
>   #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
>     __asm__ ("add%I5 %5,%r4,%1\n\tadd,dc %r2,%r3,%0"                     \
>             : "=r" (sh), "=&r" (sl)                                      \
>
> Note even though I've not encountered a system yet where uintmax_t != 64 bit,
> I'll add the guards around "#define W_TYPE_SIZE", previously mentioned in
> this thread, in a separate patch.

I've now pushed the patch set discussed in this thread,
so I'm marking this bug as done.

cheers,
Pádraig.

Subject: factor.c selects 64 bit code from longlong.h on 32-bit hppa systems
From: John David Anglin <[email-masked]>
To: [email-masked]
Cc: John David Anglin <[email-masked]>
Date: Sun, 28 Oct 2012 15:46:44 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

When USE_LONGLONG_H is defined, factor.c unilaterally defines W_TYPE_SIZE
to 64.  This selects the wrong code from longlong.h on 32-bit hppa systems
causing an assembly failure.

Attached is a hack which should work on most but probably not all systems.

Dave
-- 
J. David Anglin                                  [email-masked]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
--- factor.c.orig	Tue Oct 23 10:14:12 2012
+++ factor.c	Sun Oct 28 15:03:04 2012
@@ -124,7 +124,7 @@
 #if USE_LONGLONG_H
 
 /* Make definitions for longlong.h to make it do what it can do for us */
-# define W_TYPE_SIZE 64          /* bitcount for uintmax_t */
+# define W_TYPE_SIZE (INT64_MAX_EQ_LONG_MAX ? 64 : 32)
 # define UWtype  uintmax_t
 # define UHWtype unsigned long int
 # undef UDWtype