Bill Allombert on Mon, 17 Nov 2003 16:44:01 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: nffactor() bug


On Mon, Nov 17, 2003 at 04:16:34PM +0100, Bill Allombert wrote:
> > When I wanted to tried building a debugging binary on the same platform (via Configure -g) I got this compilation error: 
> > 
> > ../src/kernel/none/mp.c: In function `muluu':
> > ../src/kernel/none/mp.c:620: `asm' operand requires impossible reload
> 
> As far as I can tell this bug is due to a register starvation in gcc.
> Compiling this file with -O fix the problem (probably the optimised code
> use less registers).
> 
> It is not clear whether it a bug or a limitation in gcc or a bug in
> PARI.

Well, I have dug a bit further, the patch below fix the problem.

However it is not really a very good patch: the gcc limitation
occur only in two place in mp.c and only when compiled without 
any optimization.

So we need to evaluate 
1) if the patch make PARI slower with optimisation.
2) if the patch is reliable.

Cheers,
Bill


diff -u -r1.1 asm0.h
--- src/kernel/ia64/asm0.h      8 Apr 2003 15:09:31 -0000       1.1
+++ src/kernel/ia64/asm0.h      17 Nov 2003 15:33:40 -0000
@@ -1,7 +1,7 @@
 #include <stdio.h>

 // typedef unsigned long ulong;
-#define LOCAL_HIREMAINDER  register ulong hiremainder
+#define LOCAL_HIREMAINDER  ulong hiremainder
 #define LOCAL_OVERFLOW     register ulong overflow

 #define addll(a, b)                           \