Use of malloc in mpn_lshift_com optimization 2

Dennis Schridde devurandom at gmx.net
Thu Feb 15 22:01:30 UTC 2018


Hi!

I noticed an issue in GMP 6.1.2 when compiling it with CFLAGS="-pipe -O2 -
march=znver1" for x86-32 on Gentoo Linux (in chroot).  Configure fails the 
"mpn_lshift_com optimization 2" test, because that test uses `malloc` where it 
should have used `calloc`, according to an investigation by FreeBSD 
developers, who created a patch that fixes the issue (which I confirm it 
does):
 https://svnweb.freebsd.org/ports?view=revision&revision=434069

This was fixed for the "gmp" repository in "Recognise AMD zen." by Torbjorn 
Granlund <tg at gmplib.org>: https://gmplib.org/repo/gmp/rev/2ce5c60f5372
But it was not backported to the "gmp-6.1" repository.  The other recent 
commits to that file probably also qualify for backporting.

My GCC is 6.4.0 (Gentoo 6.4.0-r1 p1.3) and the Linux kernel I am running on 
currently is from Fedora Rawhide 28 (4.15.0-0.rc4.git3.1.fc28, built 
2017-12-21 16:11:35 UTC).

Best regards,
Dennis

See-Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217071
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: This is a digitally signed message part.
URL: <https://gmplib.org/list-archives/gmp-bugs/attachments/20180215/62cc016f/attachment.bin>


More information about the gmp-bugs mailing list