On Sunday 05 June 2011 05:28:09 Jason wrote:
> On Saturday 28 May 2011 20:13:34 Cactus wrote:
> > On May 28, 6:46 pm, Jason <ja...@njkfrudils.plus.com> wrote:
> > > On Saturday 28 May 2011 17:12:12 Jason wrote:
> > > > On Saturday 28 May 2011 11:36:56 Jason wrote:
> > > > > Hi
> > > > > on gcc70 which is a netburstlahf running 64bit netbsd with
> > > > > gcc-4.1.3 we get this error
> > > > > 
> > > > > PASS: t-get_d
> > > > > PASS: t-get_d_2exp
> > > > > PASS: t-get_si
> > > > > PASS: t-get_sx
> > > > > [1]   Abort trap (core dumped) "${tst}" >t-get_...
> > > > > FAIL: t-get_ux
> > > > > PASS: t-hamdist
> > > > > PASS: t-import
> > > > > PASS: t-inp_str
> > > > > PASS: t-io_raw
> > > > > PASS: t-jac
> > > > > PASS: t-lcm
> > > > > PASS: t-likely_prime_p
> > > > > 
> > > > > we do get these warning when building the tests
> > > > > 
> > > > > ibtool: link: cc -std=gnu99 -O2 -m64 -march=nocona -mtune=nocona -o
> > > > > .libs/t- get_si t-get_si.o  ../../tests/.libs/libtests.a
> > > > > /home/jasonmoxham/gcc70.fsffrance.org.06942a/gcc70.fsffrance.org.17
> > > > > 18 4a/m pi rbld/.libs/libmpir.so ../../.libs/libmpir.so -Wl,-rpath
> > > > > -Wl,/home/jason
> > > > > moxham/gcc70.fsffrance.org.06942a/gcc70.fsffrance.org.17184a/instal
> > > > > l/ lib cc -std=gnu99 -DHAVE_CONFIG_H -I.
> > > > > -I../../../../mpir-2.4.0/tests/mpz -I../.. -
> > > > > I../../../../mpir-2.4.0 -I../../../../mpir-2.4.0/tests     -O2
> > > > > -m64 - march=nocona -mtune=nocona -c
> > > > > ../../../../mpir-2.4.0/tests/mpz/t-get_sx.c
> > > > > ../../../../mpir-2.4.0/tests/mpz/t-get_sx.c: In function
> > > > > 'check_data': ../../../../mpir-2.4.0/tests/mpz/t-get_sx.c:63:
> > > > > warning: implicit declaration of function 'mpz_get_sx'
> > > > > ../../../../mpir-2.4.0/tests/mpz/t-get_sx.c: In function
> > > > > 'check_max': ../../../../mpir-2.4.0/tests/mpz/t-get_sx.c:102:
> > > > > warning: implicit declaration of function 'mpz_set_sx'
> > > > > /bin/ksh ../../libtool --tag=CC    --mode=link cc -std=gnu99  -O2
> > > > > -m64 - march=nocona -mtune=nocona    -o t-get_sx t-get_sx.o
> > > > > ../../tests/libtests.la ../../libmpir.la
> > > > > libtool: link: cc -std=gnu99 -O2 -m64 -march=nocona -mtune=nocona
> > > > > -o .libs/t- get_sx t-get_sx.o  ../../tests/.libs/libtests.a
> > > > > /home/jasonmoxham/gcc70.fsffrance.org.06942a/gcc70.fsffrance.org.17
> > > > > 18 4a/m pi rbld/.libs/libmpir.so ../../.libs/libmpir.so -Wl,-rpath
> > > > > -Wl,/home/jason
> > > > > moxham/gcc70.fsffrance.org.06942a/gcc70.fsffrance.org.17184a/instal
> > > > > l/ lib cc -std=gnu99 -DHAVE_CONFIG_H -I.
> > > > > -I../../../../mpir-2.4.0/tests/mpz -I../.. -
> > > > > I../../../../mpir-2.4.0 -I../../../../mpir-2.4.0/tests     -O2
> > > > > -m64 - march=nocona -mtune=nocona -c
> > > > > ../../../../mpir-2.4.0/tests/mpz/t-get_ux.c
> > > > > ../../../../mpir-2.4.0/tests/mpz/t-get_ux.c: In function
> > > > > 'check_data': ../../../../mpir-2.4.0/tests/mpz/t-get_ux.c:64:
> > > > > warning: implicit declaration of function 'mpz_set_ux'
> > > > > ../../../../mpir-2.4.0/tests/mpz/t-get_ux.c:65: warning: implicit
> > > > > declaration of function 'mpz_get_ux'
> > > > > /bin/ksh ../../libtool --tag=CC    --mode=link cc -std=gnu99  -O2
> > > > > -m64 - march=nocona -mtune=nocona    -o t-get_ux t-get_ux.o
> > > > > ../../tests/libtests.la ../../libmpir.la
> > > > > 
> > > > > the log is
> > > > > 
> > > > > -bash-4.1$ cat t-get_ux.log
> > > > > FAIL: t-get_ux (exit: 134)
> > > > > ==========================
> > > > > mpz_get_ux() failed for data on item 8
> > > > > 
> > > > > Jason
> > > > 
> > > > I think the error is that while t-get_sx.c has the constants
> > > > postfixed by an "L" in the t-get_ux.c we dont. However the constants
> > > > go up to 64bit so an L would break windows . What we need is the
> > > > postfix for an intmax_t , I think we can use
> > > > CNST_LIMB(0xfffffffff...) as it should be an L on unix and LL on
> > > > windows
> > > > 
> > > > Jason
> > > 
> > > look at the code I dont see what you trying to do
> > > 
> > >         mpz_set_ux(z, val[i]);
> > >         n = mpz_get_ux(z);
> > 
> > I assume here that mpz_set_ux is correct and that mpz_get_ux may be
> > wrong.
> > 
> > The variable k is the number of the limb that is about to be tested
> > and, after the test, the number of limbs that have been tested.
> > 
> > Note that k is initialised to zero.
> > 
> > > #if NLIMBS == 1
> > > 
> > >         if(n && n != z->_mp_d[k++])  // THIS SHOULD BE 0 NOT k++
> > >  
> > >  ???????????
> > 
> > When only one limb is used,  if n is zero we don't want to test the
> > limb value and we don't increment k (i.e. no limbs)
> > 
> > Otherwide we test n against the the limb value and leave k equal to 1.
> > 
> > >        if(z->_mp_size != k)   // THIS SHOULD BE 1 NOT k
> > >  
> > >  ??????????????????
> > 
> > When NLIMBS is 1 here, k will be 1 here when the number is non zero.
> > 
> > Here k is the number of limbs we have tested against the n value
> > 
> > >         {
> > >         
> > >             printf("mpz_get_ux() failed for length on item %d (mpz size:
> > > %d, size: %d)\n", i, z->_mp_size, k);
> > > 
> > >             abort();
> > >         
> > >         }
> > >         if(z->_mp_alloc < k)  // THIS SHOULD BE 1 NOT K ??????????????
> > >         {
> > >         
> > >             printf("mpz_get_ux() failed for allocation on item %d (mpz
> > > 
> > > alloc: %d, size: %d)\n", i, z->_mp_alloc, k);
> > > 
> > >             abort();
> > >         
> > >         }
> > > 
> > > I cant see how this passed on any other machine ??
> > > 
> >     Brian
> 
> I get it now , the line
>  uintmax_t k = 0, n;
> got me confused , because it's a declaration I couldn't see that k gets set
> to 0 on every loop , DUH...
> 
> The error is a compiler bug , mpz_set_ux(z,0xFFFFFFFF) does the right thing
> but n=mpz_get_ux(z) returns 0xFFFFFFFFFFFFFFFF so the line
> return (uintmax_t)(z->_mp_size ? z->_mp_d[0] : 0);
> is compiled wrong
> I'll set up a test so we reject this compiler
> 
> Jason

We cant set up the test as the compiler tests are done before we know we have 
stdint.h , so the test would also fail on any system without stdint , we could 
require that on unix like systems we require stdint.h and inttypes.h (which  
came in with the C99 standard)

Jason

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To post to this group, send email to mpir-devel@googlegroups.com.
To unsubscribe from this group, send email to 
mpir-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/mpir-devel?hl=en.

Reply via email to