Iwao KIMURA on Sun, 23 May 1999 01:54:40 +0900


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

patch for galconj.c


Hi all,

I built 2.0.15.beta on AIX 4.2 by C Set ++ for AIX (ver3 rel1).
The following modification was needed (as Igor and Ilya said):
--------------------
iwao@math02:/export/home1/math/staff/iwao/pari-csetpp/pari-2.0.15.beta/ 
{64}% diff -u src/basemath/galconj.c.orig src/basemath/galconj.c
--- src/basemath/galconj.c.orig Sat May 22 23:15:13 1999
+++ src/basemath/galconj.c      Sun May 23 01:09:58 1999
@@ -1313,7 +1313,7 @@
 GEN
 a4galoisgen(GEN T,struct test_data *td)
 {
-  int ltop=avma,av,av2;
+  long ltop=avma,av,av2;
   int i,j,k;
   int n;
   int N,hop=0;
@@ -1326,14 +1326,17 @@
   res=cgetg(4,t_VEC);
   ry=cgetg(3,t_VEC);
   res[1]=(long)ry;
-  (long)pft=ry[1]=lgetg(n+1,t_VECSMALL);
+  ry[1]=lgetg(n+1,t_VECSMALL);
+  pft=(GEN) ry[1];
   ry[2]=(long)stoi(2);
   ry=cgetg(3,t_VEC);
-  (long)pfu=ry[1]=lgetg(n+1,t_VECSMALL);
+  ry[1]=lgetg(n+1,t_VECSMALL);
+  pfu=(GEN)ry[1];
   ry[2]=(long)stoi(2);
   res[2]=(long)ry;
   ry=cgetg(3,t_VEC);
-  (long)pfv=ry[1]=lgetg(n+1,t_VECSMALL);
+  ry[1]=lgetg(n+1,t_VECSMALL);
+  pfv=(GEN)ry[1];
   ry[2]=(long)stoi(3);
   res[3]=(long)ry;
   av=avma;
--------------------
Typecasting in lvalue is allowed in gcc, but would you please recall
that there are another compiler in the world.  After this
modification, gp-sta pass the test.

As G. Niklasch wrote in
http://hasse.mathematik.tu-muenchen.de/ntsw/pari/inst/aix.html
when one compiles PARI by C Set ++ for AIX, optimization shold not be
specified (oterwise the binary runs very slow). But when one use gcc
2.8.1, the optimization flag is important. I compiled PARI by C Set
++ for AIX and gcc 2.8.1 in many optimization flag, I found that the
fastest one is that compiled by gcc optimised as `-O2 -DGCC_INLINE
-mtune=604e' (though the assembler produce many warnigs). I hope this
helps somebody :-)

	;#	Iwao KIMURA			;#
	;#	Faculty. Math, Dept. of Sciece	;#
	;#	Toyama University		;#