Ciao, Il Lun, 12 Marzo 2018 4:57 pm, Torbjörn Granlund ha scritto: > > ... 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...
> Only the sensitive target variable would seem to need a volatile decl. You mean we should declare static volatile int c = 0; Sounds like and oxymoron to me :-) Or should we use another variable, similar in some way to the fat code? double mpz_get_d (const mpz_t u) { static int c = 0; static int __initialized = 0; if (__initialized != 1) { c = gmp_tests_dbl_mant_bits (); *((volatile int *) &__initialized) = 1; } ... Ĝis, m -- http://bodrato.it/ _______________________________________________ gmp-devel mailing list gmp-devel@gmplib.org https://gmplib.org/mailman/listinfo/gmp-devel