Re: Help stabilising mini-gmp

2016-11-20 Thread Torbjörn Granlund
ni...@lysator.liu.se (Niels Möller) writes: Anyway, I can now repro locally, by running make check CFLAGS="-O -Wall -g -fsanitize=undefined -fno-sanitize-recover" in the mini-gmp/tests source directory. This fails with I spent a good number of hours trying to accompish this. 1.

Re: Help stabilising mini-gmp

2016-11-20 Thread Niels Möller
"Marco Bodrato" writes: > Should we implement (or adapt) something like the tests/devel/try thing to > widely test the basic operations in mini-gmp? I think devel/try is mainly for testing assembly code, to find register clobbering bugs and the like. For mini-gmp, I

Re: Help stabilising mini-gmp

2016-11-20 Thread Torbjörn Granlund
ni...@lysator.liu.se (Niels Möller) writes: I've checked in an update to the html file. But running www-update fails, [nisse@shell /var/hg]$ ./www-update abort: Permission denied: '/var/hg/www/devel/mini-gmp-status.html' Please try again now. Before doing a ww-update, it would

Reorganized mini-gmp/tests/t-signed.

2016-11-20 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > Anyway, I can now repro locally, by running > > make check CFLAGS="-O -Wall -g -fsanitize=undefined -fno-sanitize-recover" > > in the mini-gmp/tests source directory. This fails with > > t-signed.c:93:8: runtime error: signed integer overflow: -1

Re: Help stabilising mini-gmp

2016-11-20 Thread Torbjörn Granlund
> It would make sense to test both gmp and mini-gmp with > -fsanitize=undefined. If we are not already doing it, yes, I highly recommend it. I also highly recommend it and the system noasm should hopefully obey our recommendations in its next run. ;-) (The hardware martin.gmplib.org

Re: Help stabilising mini-gmp

2016-11-20 Thread Marc Glisse
On Sun, 20 Nov 2016, Niels Möller wrote: It would make sense to test both gmp and mini-gmp with -fsanitize=undefined. If we are not already doing it, yes, I highly recommend it. -- Marc Glisse ___ gmp-devel mailing list gmp-devel@gmplib.org

Re: Help stabilising mini-gmp

2016-11-20 Thread Torbjörn Granlund
> If the code becomes undefined by gcc's transformations, that it's a > compiler bug. That's not at all what I said, the code doesn't become undefined. I didn't say you said that. :-) "Reminder: computing INT_MIN-1 is forbidden. If you are not doing that, you can ignore this

Re: Help stabilising mini-gmp

2016-11-20 Thread Niels Möller
Marc Glisse writes: > After inlining, there are subtractions. check_si is called at least > once with oi = si + c (c is ±1). gcc simplifies the test si > si - 1 > to true, and warns that this optimization may break your program if > you rely on wrapping. I suspect this

Re: Help stabilising mini-gmp

2016-11-20 Thread Marc Glisse
On Sun, 20 Nov 2016, Torbjörn Granlund wrote: Marc Glisse writes: After inlining, there are subtractions. check_si is called at least once with oi = si + c (c is ±1). gcc simplifies the test si > si - 1 Inlining of check_si? Of all the functions. (note that I am

Re: Help stabilising mini-gmp

2016-11-20 Thread Torbjörn Granlund
Marc Glisse writes: After inlining, there are subtractions. check_si is called at least once with oi = si + c (c is ±1). gcc simplifies the test si > si - 1 Inlining of check_si? If the code becomes undefined by gcc's transformations, that it's a compiler bug. --

Re: Help stabilising mini-gmp

2016-11-20 Thread Torbjörn Granlund
ni...@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

Re: Help stabilising mini-gmp

2016-11-20 Thread Marc Glisse
On Sun, 20 Nov 2016, Niels Möller wrote: ni...@lysator.liu.se (Niels Möller) writes: It seems "trivially" reproducible on ppc64 though, both real metal versions and fake ones like ppceb-debv8 (and ppcel-debv8). I'll try to debug (if no one else beats me to it), but not today. I've logged

Re: Help stabilising mini-gmp

2016-11-20 Thread Niels Möller
t...@gmplib.org (Torbjörn Granlund) writes: > There are currently 10 outstanding mini-gmp issues according to > , will be 9 if your > LD_LIBRARY_PATH change is effective. Is it up-to-date? I think the three red arithmetic bugs (t-gcd, t-powm and