rand_nw.c: compensate for gcc bug (using %edx instead of %eax at -O3)
authorAndy Polyakov <appro@openssl.org>
Thu, 8 Jul 2010 09:15:49 +0000 (09:15 +0000)
committerAndy Polyakov <appro@openssl.org>
Thu, 8 Jul 2010 09:15:49 +0000 (09:15 +0000)
[from HEAD].
PR: 2296

crypto/rand/rand_nw.c

index f177ffb..8d5b8d2 100644 (file)
@@ -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);