Help stabilising mini-gmp

Torbjörn Granlund tg at gmplib.org
Sun Nov 20 17:04:57 UTC 2016


nisse at lysator.liu.se (Niels Möller) writes:

  I next tried adding -Wall to the command line flags, and I see
  
    gcc -std=gnu99 -m64  -mtune=power7 -O3 -Wall -I../.. -c
    /home/nisse/hack/gmp/mini-gmp/tests/t-signed.c -o t-signed.o
    /home/nisse/hack/gmp/mini-gmp/tests/t-signed.c: In function 'testmain':
    /home/nisse/hack/gmp/mini-gmp/tests/t-signed.c:45:26: warning: assuming
    signed overflow does not occur when assuming that (X - c) > X is always
    false [-Wstrict-overflow]
       if ((si < oi ? -1 : si > oi) != c)
                              ^
    /home/nisse/hack/gmp/mini-gmp/tests/t-signed.c:45:21: warning: assuming
    signed overflow does not occur when assuming that (X + c) >= X is always
    true [-Wstrict-overflow]
       if ((si < oi ? -1 : si > oi) != c)
                       ^
  
  I don't quite understand neither what the testcase is doing, nor what the
  warning means, since there's no subtraction in there.
  
It looks like a confused compiler.  Perhaps the test failure is caused
by the same confusion?

ppc64eb.sys (and ppc64el.sys) run the same environment, but under full
system emulation.  They provide gdb.  But these systems are slow (slower
single cpu performance, and no SMP).

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-devel mailing list