Re: Report: gmp-6.1.2 on MacOS 10.15 using GCC and two Clang

2019-10-20 Thread Hans Åberg
> On 20 Oct 2019, at 21:44, Torbjörn Granlund wrote: > > Hans Åberg writes: > > A common programming error is assuming that signed integer types are > two’s complement, because even though all current CPUs are that, > overflows are undefined in C/C++, and an optimizer can take advantage >

Re: Report: gmp-6.1.2 on MacOS 10.15 using GCC and two Clang

2019-10-20 Thread Torbjörn Granlund
Hans Åberg writes: Strictly, it is for signed overflows one cannot assume modulo 2^n, n = number of bits. For the unsigned integer types it is required, though. Believe it or not, but the GMP devs are pretty good at computer arithmetic. -- Torbjörn Please encrypt, key id 0xC8601622

Re: Report: gmp-6.1.2 on MacOS 10.15 using GCC and two Clang

2019-10-20 Thread Torbjörn Granlund
Hans Åberg writes: A common programming error is assuming that signed integer types are two’s complement, because even though all current CPUs are that, overflows are undefined in C/C++, and an optimizer can take advantage of that. One example from [1]: checking overflows with x > x + 1

Re: Report: gmp-6.1.2 on MacOS 10.15 using GCC and two Clang

2019-10-20 Thread Hans Åberg
> On 20 Oct 2019, at 13:24, Torbjörn Granlund wrote: > > Hans Åberg writes: > > I have compiled gmp-6.1.2 on MacOS 10.15 using the inhouse Apple clang > and the MacPorts gcc9 and clang9, with ‘make check’. All tests passed > on gcc9, but the two clang had one error each. > > Several

Re: Report: gmp-6.1.2 on MacOS 10.15 using GCC and two Clang

2019-10-20 Thread Torbjörn Granlund
Hans Åberg writes: I have compiled gmp-6.1.2 on MacOS 10.15 using the inhouse Apple clang and the MacPorts gcc9 and clang9, with ‘make check’. All tests passed on gcc9, but the two clang had one error each. Several people seem to have trouble with using clang. When clang first appeared,

Report: gmp-6.1.2 on MacOS 10.15 using GCC and two Clang

2019-10-20 Thread Hans Åberg
I have compiled gmp-6.1.2 on MacOS 10.15 using the inhouse Apple clang and the MacPorts gcc9 and clang9, with ‘make check’. All tests passed on gcc9, but the two clang had one error each. % uname -a Darwin Kernel Version 19.0.0: Wed Sep 25 20:18:50 PDT 2019;