mpz_gcd() is going to use malloc unless the newer GMP code is much different. Even the old mpn_gcd() used malloc. I don't really view this as acceptable, but it is easy.