Possible bug affecting mpz_popcount() in GMP 5.0.1 on Intel Core2

Torbjorn Granlund tg at gmplib.org
Fri Apr 15 14:49:19 CEST 2011


Roberto Bagnara <bagnara at cs.unipr.it> writes:

  Can someone please try to reproduce the following?
  
It is difficult to find the essentials in your long text.  What is the
claim, is it that the code performs a 16-byte aligned 16-byte load and
that part of this load is outside of an allocated buffer?

If that is the claim, then I'd say GMP is not too naughty; we allow
ourself to read beyond buffer ends as long as we don't cross a possible
page boundary.  (We don't do this from C as this is invalid, but we do
it in assembly since there we can make this type of assumptions about
the hardware.)

-- 
Torbjörn


More information about the gmp-discuss mailing list