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:14 +0000 (09:15 +0000)
committerAndy Polyakov <appro@openssl.org>
Thu, 8 Jul 2010 09:15:14 +0000 (09:15 +0000)
[from HEAD].
PR: 2296

crypto/rand/rand_nw.c

index f177ffbe82b08e16b43ae1d2e886dbe459a7dbfd..8d5b8d2e3217f438a4030308528112c872a7403c 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);