mini-gmp mpz_{get,set}_d not fully compatible with GMP

Torbjörn Granlund tg at gmplib.org
Mon Mar 12 15:57:49 UTC 2018


  > ... if the compiler inlines the static gmp_tests_dbl_mant_bits function,
  > and optimizes away the local variable n, directly updating c in the loop,
  > then it can be a problem... suggestions?
  > We can declare c as int and n as unsigned. But I fear this is not a real 
  > obstacle for an optimizer.

  Might help to declare c and/or n as volatile.

Only the sensitive target variable would seem to need a volatile decl.

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-devel mailing list