Should we declare _itch functions __GMP_NOTHROW __GMP_ATTRIBUTE_PURE ?

bodrato at bodrato at
Sun Jan 5 13:59:06 UTC 2014


Looking at

I saw that the function mpn_sec_powm_itch() is called twice for each
mpn_sec_powm(). This depends (I assume) because of the multiple evaluation
in the macro TMP_ALLOC_LIMBS (n + mpn_sec_powm_itch (bn, en, n));
in /mpz/powm_sec.c .

Of course we can heal the code by precomputing n+itch to use the macro on
a single variable, but, shouldn't we suggest the compiler that all the
_itch functions are pure anyway?



More information about the gmp-devel mailing list