Bill Allombert on Sat, 29 Nov 2003 02:24:44 +0100


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

build failure with gcc 3.3 on x86


Hello PARI-dev,

Recent changes from Karim cause PARI to be broken when compiled
with gcc 3.3 on x86, see <http://pari.math.u-bordeaux.fr/buildlog.html>

The following patch fix that.

This is not a very good patch, but it explains the problem:
oldrel point to a value in the cache but is not updated when the
cache is reallocated. Apparently oldrel is used afterward.

Cheers,
Bill.

Index: src/basemath/buch2.c
===================================================================
RCS file: /home/cvs/pari/src/basemath/buch2.c,v
retrieving revision 1.212
diff -u -r1.212 buch2.c
--- src/basemath/buch2.c        28 Nov 2003 10:42:33 -0000      1.212
+++ src/basemath/buch2.c        29 Nov 2003 01:10:02 -0000
@@ -3114,7 +3114,7 @@
     { /* reduced the relation matrix at least once */
       long lgex = max(nlze, MIN_EXTRA); /* # of new relations sought */
       size_t slim = (cache.last - cache.base) + lgex;
-      if (slim > cache.len) reallocate(&cache, slim << 1);
+      if (slim > cache.len) {long dec=oldrel-cache.base;reallocate(&cache, slim << 1);oldrel = cache.base+dec;}
       cache.end = cache.base + slim;
       for (rel = cache.last + 1; rel <= cache.end; rel++) rel->R = col_0(F.KC);       if (DEBUGLEVEL)