From: Andy Polyakov Date: Thu, 8 Jul 2010 09:15:49 +0000 (+0000) Subject: rand_nw.c: compensate for gcc bug (using %edx instead of %eax at -O3) X-Git-Tag: OpenSSL_1_0_1-beta1~496 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b29b89ef215c6fda3bec921f7fbc5def18a69c15;p=oweals%2Fopenssl.git rand_nw.c: compensate for gcc bug (using %edx instead of %eax at -O3) [from HEAD]. PR: 2296 --- diff --git a/crypto/rand/rand_nw.c b/crypto/rand/rand_nw.c index f177ffbe82..8d5b8d2e32 100644 --- a/crypto/rand/rand_nw.c +++ b/crypto/rand/rand_nw.c @@ -160,8 +160,8 @@ int RAND_poll(void) rdtsc mov tsc, eax } -#else - asm volatile("rdtsc":"=A" (tsc)); +#elif defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) + asm volatile("rdtsc":"=a"(tsc)::"edx"); #endif RAND_add(&tsc, sizeof(tsc), 1);