Re: [cfarm-announces] New Arm Morello SoC machine: cfarm240

2023-08-24 Thread Paul Zimmermann
Hi, gmp 6.3.0 does not compile on this machine: zimmerma@cfarm240:~/gmp-6.3.0 $ ./configure checking build system type... Invalid configuration 'aarch64c-unknown-freebsd14.0': machine 'aarch64c-unknown' not recognized configure: error: /bin/sh ./config.sub aarch64c-unknown-freebsd14.0 fai

bug in __gmp_replacement_vsnprintf

2023-08-21 Thread Paul Zimmermann
Hi, here is a small program that exhibits the bug (for example on gcc231): gcc231$ cat bug.c #include #include #include static void foo (char **buf, const char *fmt, ...) { va_list ap; va_start (ap, fmt); gmp_vasprintf (buf, fmt, ap); va_end (ap); } int main (int argc, char **

Re: GMP Error Reporting

2023-08-21 Thread Paul Zimmermann
Hi, it appears the value of c3 before the call mpf_sqrt() is negative, and mpf_sqrt() does not allow negative inputs. Best regards, Paul Zimmermann > From: "posihydr" > Date: Sat, 19 Aug 2023 21:50:37 +0800 > > > [1:text/plain Hide] > > A descriptio

bug in __gmp_replacement_vsnprintf

2023-08-19 Thread Paul Zimmermann
ping: https://gmplib.org/list-archives/gmp-bugs/2022-October/005200.html The bug was acknowledged by Niels in January: https://gmplib.org/list-archives/gmp-bugs/2023-January/005230.html but not fixed in 6.3.0. Paul ___ gmp-bugs mailing list gmp-bugs@

IEEE P754

2023-07-31 Thread Paul Zimmermann
Hi, the reference manual mentions IEEE P754, which was the temporary name during the standard first version (Project 754 I guess). It should be replaced by IEEE 754, or better IEEE 754-2019 (the latest revision). Paul ___ gmp-bugs mailing list gm

Re: bug

2023-07-31 Thread Paul Zimmermann
mpfr_get_str(str, &myexp, 10, 99, x, MPFR_RNDN); mpfr_clear(x); printf("%s\n",str); } $ gcc f.c -lmpfr $ ./a.out 693147180559945309417232121458176568075500134360255254120680009493393621969694715605863326996418688 Best regards, Paul Zimmermann PS: followups about MPFR should

issue with Microsoft compiler

2023-02-13 Thread Paul Zimmermann
Hi, someone reported to me the following issue: Microsoft (R) C/C++ Optimizing Compiler Version 19.34.31937 for x64 will not compile line 2230 in gmp.h: *__gmp_rp = (- *__gmp_up) & GMP_NUMB_MASK; giving error C4146: unary minus operator applied to unsigned type, resul

bug in __gmp_replacement_vsnprintf

2022-11-21 Thread Paul Zimmermann
Hi, this bug report got no feedback so far: https://gmplib.org/list-archives/gmp-bugs/2022-October/005200.html Do the GMP developers acknowledge it? Best regards, Paul ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/lis

bug in __gmp_replacement_vsnprintf

2022-10-12 Thread Paul Zimmermann
Hi, [for the record, this issue was originally reported on the MPFR list: https://sympa.inria.fr/sympa/arc/mpfr/2022-10/msg1.html] Originally, it appeared only under Windows with the clang compiler, and using MPIR, but I can reproduce it under Linux with GMP 6.2.1: 1) configure GMP 2)

Re: GMP does not detect float exponent overflow while reading floating point numbers

2022-09-29 Thread Paul Zimmermann
Hi Eric, > GMP version: gmp-6.2.1-2.fc36.x86_64, installed using dnf on Fedora 36. > Test program: a.c and b.cpp, see attachment. > To run a.c, use "gcc a.c -o a -lgmp && ./a". The output on my machine > is "0.1e-3215911262793760767". > To run b.cpp, use "g++ b.cpp -o b -lgmp -lgmpxx && ./

Re: mini-gmp mpz_powm incorrect result

2022-08-29 Thread Paul Zimmermann
thank you, I confirm the bug, here is a potential fix: $ diff -u mini-gmp.c.orig mini-gmp.c --- mini-gmp.c.orig 2022-08-29 10:28:20.700995412 +0200 +++ mini-gmp.c 2022-08-29 10:27:36.112191428 +0200 @@ -3060,6 +3060,7 @@ if (en == 0) { mpz_set_ui (r, 1); + mpz_tdiv_r (r, r

mail archives are lost

2022-02-20 Thread Paul Zimmermann
Hi, not sure this is the best place to report. Since November 2021, the archives of the GMP mailing lists are no longer available. This is a pity since those archives contain a lot of useful information (except this mail of course). Best regards, Paul __

Re: Segmentation fault with mpz_inp_raw on gcc45

2021-09-16 Thread Paul Zimmermann
Hi Torbjörn, I confirm your fix works on gcc45: zimmerma@gcc45:~/ecm$ gcc -I$HOME/include test.c $HOME/lib/libgmp.a zimmerma@gcc45:~/ecm$ ./a.out XXX 2d65200d 0b594804 gmp: overflow in mpz type Aborted Thanks, Paul ___ gmp-bugs mailing list gmp

Re: Segmentation fault with mpz_inp_raw on gcc45

2021-09-15 Thread Paul Zimmermann
sorry the test_dummy2.save is attached. It was generated by (under /bin/sh, not /bin/bash): echo -e "\n\r\n\r# this is a comment line and should be ignored" > test_dummy2.save Paul test_dummy2.save Description: Binary data ___ gmp-bugs mailing list gm

Re: Segmentation fault with mpz_inp_raw on gcc45

2021-09-15 Thread Paul Zimmermann
> OK, so you deliberately sen d junk to mpz_inp_raw. That is fine, but it > was not clear from your report. it was not completely deliberate. The long story is that I tested "make check" of GMP-ECM on gcc45 with some recent merge request, and with /bin/sh the command echo -e "..." > xxx did put t

Re: Segmentation fault with mpz_inp_raw on gcc45

2021-09-15 Thread Paul Zimmermann
Dear Torbjörn, > $ cat test_dummy2.save > -e > > # this is a comment line and should be ignored > > You do understand that mpz_inp_raw expects a binary file with a size > field followed by that many byytes of data, don't you? > > The file contents above make no sense. the document

Segmentation fault with mpz_inp_raw on gcc45

2021-09-15 Thread Paul Zimmermann
Hi, with gmp-6.2.1 and the following program: zimmerma@gcc45:~/ecm$ cat test.c #include #include #include main() { mpz_t s; FILE *file; int ret; mpz_init (s); file = fopen ("test_dummy2.save", "rb"); ret = mpz_inp_raw (s, file); } I get a Segmentation fault on gcc45 with t

Re: Rounding error

2021-09-08 Thread Paul Zimmermann
f course you can add say 100 guard bits, then the probability to get an incorrect rounding is about 2^-100... Best regards, Paul Zimmermann ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: memory leak huge number of digits mpz_mul,mpf_sqrt_ui

2021-02-26 Thread Paul Zimmermann
are possible Does valgrind report a memory leak with your original value num=2? Best regards, Paul Zimmermann ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: Limitation of the mpz_get_str function

2021-02-16 Thread Paul Zimmermann
Hi Christophe, this issue is known since several years: https://gmplib.org/list-archives/gmp-bugs/2019-September/004633.html Paul > From: Christophe Clavier > Date: Tue, 16 Feb 2021 14:22:20 +0100 > > Dear GMP developers, > > I currently have to deal with huge numbers (several billion

Re: A message bug. At least Version 6.2.0

2020-12-22 Thread Paul Zimmermann
> In mini-gmp.c function mpz_export, when calling gmp_die("mpz_import: ...") > instead of gmp_die("mpz_export: ...") btw, are nails still supported for current architectures? On x86_64 I get: $ ./configure --enable-nails ... configure: error: no version of invert_limb_table found in path: x86_

Re: Debian Linux SPARC64 issue with FAIL t-printf (exit status: 139)

2020-11-17 Thread Paul Zimmermann
Dear Dennis, > With an old old Sun Nera server running very latest Debian sid I was > surprised to see : [...] does the same error occur with previous GMP versions, or is it specific to 6.2.1? Paul ___ gmp-bugs mailing list gmp-bugs@gmplib.org h

Re: gmp 6.2.0 documentation bug

2020-09-29 Thread Paul Zimmermann
Hi Tony, > I think there is a word (a function name?) missing from the > documentation for gmp 6.2.0. In gmp.texi, at line 2541 it reads: > > "it's probably best to call to get a starting point and iterate from there." > > Should there be a function name after "call"? yes, I guess you

commits not available on the mercurial page

2020-09-21 Thread Paul Zimmermann
Hi, on https://gmplib.org/repo/gmp/shortlog when I click on a commit, I get an almost empty page, and I cannot see the corresponding diff. Am I the only one? Is that a temporary problem? Paul ___ gmp-bugs mailing list gmp-bugs@gmplib.org https:/

Re: mpz_sizeinbase() bug

2020-08-19 Thread Paul Zimmermann
the exact size, use mpz_get_str() and strlen(), or mpz_ui_pow_ui() and mpz_cmp(). Paul Zimmermann > Date: Wed, 19 Aug 2020 02:21:51 +0200 > From: "Lebender, Johannes" > > Dear GMP maintainers, > > i found a possible bug in the mpz_sizeinbase() function. e.g. > m

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-17 Thread Paul Zimmermann
Dear Torbjörn, > A crude test generator: [...] great! On gcc115 it fails with the longlong.h shipped with GMP 6.2.0: zimmerma@gcc115:/tmp/gmp-6.2.0$ /opt/cfarm/gcc-latest/bin/gcc test.c zimmerma@gcc115:/tmp/gmp-6.2.0$ ./a.out > test1.c zimmerma@gcc115:/tmp/gmp-6.2.0$ /opt/cfarm/gcc-latest

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-17 Thread Paul Zimmermann
Dear Niels, > Sorry for being unclear, sub_ddmmss has six arguments, and the case I > wanted to single out was > >sub_ddmmss(rh, rl, ah, al, bh, /*compile time constant*/0) > > > in MPFR we have 15 places where we call sub_ddmmss, among which 8 have bl=0: > > Those seem to have al =

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-17 Thread Paul Zimmermann
Dear Niels, > The excluded case, > > sub_ddmmss(ah, al, bh, /*compile time constant*/0) > > could clearly be optimized, in a different way, but I'd guess it's rare > enough in real code to not be worth the effort? in MPFR we have 15 places where we call sub_ddmmss, among which 8 have

Re: bug in longlong.h for aarch64 sub_ddmmss

2020-06-16 Thread Paul Zimmermann
Dear Torbjörn, > This bug comes untimely for me. I consider a major purge along the > lines of the patch below. [...] I confirm all MPFR 4.1.0-rc1 tests pass on gcc115 with this patch applied to mpfr-longlong.h, both with GCC 9.1.0 and 10.1.0 (they failed with GCC 9.1.0), where mpfr-longl

Re: efficiency bug in mpz_powm_ui?

2020-03-02 Thread paul zimmermann
Dear Marco, > > it seems that mpz_powm_ui is highly inefficient when BASE^EXP has about > > the > > same size as MOD, in which case it could first compute BASE^EXP > > exactly, then > > perform only one reduction: > > You are right, mpz_powm_ui does not implement an algorithm that is >

efficiency bug in mpz_powm_ui?

2020-02-29 Thread paul zimmermann
Hi, it seems that mpz_powm_ui is highly inefficient when BASE^EXP has about the same size as MOD, in which case it could first compute BASE^EXP exactly, then perform only one reduction: zimmerma@tomate:/tmp$ ./a.out 10 GMP version: 6.2.0 mpz_ui_pow_ui+mpz_mod took 100ms set_ui+mpz_powm

Re: segmentation fault in t-toom53 test with MAC OS X Catalina (Clang 11.0)

2019-11-09 Thread paul zimmermann
Dear Juergen, > There are more problems in mpfr, and mpc does not even compile. > Is this already known? please report mpfr and mpc specific issues to the corresponding lists. Paul Zimmermann ___ gmp-bugs mailing list gmp-bugs@gmplib.org

Re: bug in gmp_fprintf still in next release?

2019-09-27 Thread paul zimmermann
> From: t...@gmplib.org (Torbjörn Granlund) > Date: Fri, 27 Sep 2019 14:06:34 +0200 > > Marc Glisse writes: > > The report was also about mpz_get_str, which does not have this > limitation. And for printf, it should be possible to make it print > correctly and return a nonsense integer. >

bug in gmp_fprintf still in next release?

2019-09-25 Thread paul zimmermann
Best regards, Paul Zimmermann [1] https://gmplib.org/list-archives/gmp-bugs/2015-November/003795.html ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: not really a bug but somewhat odd : checking compiler /usr/local/bin/gcc8 ... no, mpn_lshift_com

2019-07-28 Thread paul zimmermann
Hi Dennis, > Dear gmp/mpfr folks : this apparently has nothing to do with mpfr. >From the error message in configure ("no, mpn_lshift_com optimization 2, program does not run") you can conclude that your compiler is broken. Please report to the compiler vendor. Paul _

Re: possible bug in mpz_cmp_d

2018-07-10 Thread paul zimmermann
> On Mon, Jul 09, 2018 at 11:04:57PM -0600, Tom Tromey wrote: > [...] > > double d = -2305843009213693953.0; > [...] > > I expect this to print 0, because the numbers are the same, and because > > the number can be exactly represented as a double. > > I don't think so. > > d is -(2^61+1). Y

speed -P

2018-03-15 Thread paul zimmermann
Hi, there is a bug in the -P option of speed in GMP 6.1.2: $ ./speed -P foo -s 1-1000 mpn_mul_n $ gnuplot --persist foo.gnuplot If you look at the caption, the _ character in mpn_mul_n is interpreted as a subscript in Gnuplot (I have gnuplot 5.2 patchlevel 2), thus mpn_mul_n is not correc

Re: [MPFR] Mac OS X power pc issue with C99

2018-02-19 Thread paul zimmermann
t-4-4-4-on-Mac-OS-X-Leopard-with-gcc-4-2-td8706i20.html The most useful answer I found is that one: https://gmplib.org/list-archives/gmp-bugs/2010-January/001747.html Hope this helps, Paul Zimmermann ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://

rsblsh2_n.asm

2018-02-14 Thread paul zimmermann
Hi, in gmp-6.1.2 (and in the daily snapshot gmp-6.1.99-20180214), the head of mpn/rsblsh2_n.asm on x86_64 says: dnl AMD64 mpn_addlsh2_n -- rp[] = up[] + (vp[] << 1) dnl AMD64 mpn_rsblsh2_n -- rp[] = (vp[] << 1) - up[] I guess it should be: dnl AMD64 mpn_addlsh2_n -- rp[] = up[] + (vp[

Re: printf/repl-vsnprintf.c bug (was: GMP|MPIR|MPFR assertions)

2018-01-18 Thread paul zimmermann
it should be noted that this bug was not found by GMP's "make check" (to my best knowledge), but only by MPFR's test suite. Before fixing the bug, it would be nice to fix the GMP test suite. Paul ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gm

Re: printf/repl-vsnprintf.c bug (was: GMP|MPIR|MPFR assertions)

2018-01-18 Thread paul zimmermann
> > printf/repl-vsnprintf.c seems buggy for floating-point specifiers > > (EeGgFf). Replace "break" by "goto next" (2 occurrences)? > > Proposed patch attached. Not tested. here is a test case to reproduce the issue (you have to test it on a system that doesn't have vsnprintf, or only has a broke

Re: Issue related to mpf_set_default_prec()

2017-12-13 Thread paul zimmermann
Hi, I could not reproduce your problem. Please could you send the exact modified program you use? Paul Zimmermann ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs

Re: issues on gcc202

2017-08-31 Thread paul zimmermann
Dear Torbjörn, > This is not yet isolated. It looks like a compiler or perhaps more > likely a linker bug. Last night I reverted another change which > benefited gcc202, so now there will be more errors. > > I am not actively working on this issue, but I will probably isolate i

issues on gcc202

2017-08-29 Thread paul zimmermann
I find several issues on gcc202.fsffrance.org: 1) gmp-6.1.2 configured with --disable-shared and gcc 7.2.0: libgmp.a contains an undefined symbol __gmpn_addlsh1_n_ip1: zimmerma@gcc202:/tmp/gmp-6.1.2$ cat e.c #include "gmp.h" int main() { mpz_t x; mpz_init_set_str (x, "1234

Re: Assertion failure in mpz_divexact()

2017-08-27 Thread paul zimmermann
I can reproduce this on my laptop, with the gmp-6.1.99-20170821 snapshot, and gcc 5.4.0, Ubuntu 16.04. Moreover with that snapshot, make check fails: zimmerma@mure:/tmp/gmp-6.1.99-20170821$ make check ... make[5]: Entering directory '/tmp/gmp-6.1.99-20170821/tests' ../test-driver: line 107: INTERP

Re: Jacobi Symbol

2017-08-22 Thread paul zimmermann
Dear Niels, > I'm attaching my draft paper explaining the algorithm used in GMP. This > was written back in 2010, do you know if the algorithm has been > published elsewhere in the meantime? The trick (i.e., using part (v) and > (vi) of Proposition 1) dates back at least to work by Schönhag

Jacobi Symbol

2017-08-21 Thread paul zimmermann
Hi, since GMP 5.1.0, i.e., 8 versions of GMP, the documentation says: 15.3.5 Jacobi Symbol [This section is obsolete. The current Jacobi code actually uses a very efficient algorithm.] I just checked the latest daily snapshot, it is still the same. When

documentation bug

2017-06-06 Thread paul zimmermann
he strong probable prime test. >However, in a strong probable prime test, the second check should be > x^(q2^j) mod n is -1, for 1 <= j < k. > >The manual is wrong, right? Do you know if the code is correctly written? Paul Zimmermann __

Re: x86_64-w64-mingw32 test FAIL t-scanf.c:1477: GNU MP assertion failed: ret == (-1)

2017-04-01 Thread paul zimmermann
Torbjörn, > Should we pass this option for mingw on GMP's configure.ac? > Or do people expect broken libc on this platform...? note we have this in MPFR INSTALL file: 3 - To avoid using the Microsoft runtime (which might not be conform to ISO C), you can use the MinGW runtime package

Re: mpf_get_d_2exp ignores sign of input

2017-03-07 Thread paul zimmermann
Torbjörn, > mpf_get_d_2exp() always returns a non-negative value, even for negative > input. I think this is a bug. > > The function works as documented. No bug. I disagree. The fine manual says "D * 2^EXP is the (truncated) OP value", which is wrong if say OP = -0.5. And why bot

critical bug

2016-12-28 Thread paul zimmermann
Dear GMP developers, I've found a critical bug in gmp-6.1.2, file mpn/x86_64/invert_limb.asm, line 91: C v3 = (v2 << 31) + (v2 * (2^96 - v2 * d63 + ((v2 >> 1) & mask)) >> 65 A closing parenthesis is missing. Happy end of 2016 to all of you! Paul

Re: building gmp-6.1 for s390 (31-bit) w/asm disabled failing with undefined sdiv_qrnnd

2016-12-14 Thread paul zimmermann
Torbjörn, > From: t...@gmplib.org (Torbjörn Granlund) > Date: Wed, 14 Dec 2016 21:33:10 +0100 > > Vincent Lefevre writes: > > I suppose that if one doesn't use the macros that depend on > GMP internals, there should be no problems. In particular, > udiv_qrnnd is not used, unless th

Re: building gmp-6.1 for s390 (31-bit) w/asm disabled failing with undefined sdiv_qrnnd

2016-12-13 Thread paul zimmermann
Hi Torbjörn, > We're probably going to create many more problems for extension libs for > GMP 7. It will be the first release to support symbol hiding, and while > we're not going to be fascist about our "private" symbols, we're going > to make truly internal things hidden. then please ad

critical bug

2016-02-16 Thread paul zimmermann
Hi, I found a critical bug in gmp-6.1.0/mpn/s390_64/README: There are 5 generations of 64-but s390 processors, [...] It should be "64-bit" instead. Paul ___ gmp-bugs mailing list gmp-bugs@gmplib.org https://gmplib.org/mailman/listinfo/gmp-bugs