changeset 55550:599a7a7b6f77

8226525: HotSpot compile-time error for x86-32 Reviewed-by: shade
author aph
date Tue, 02 Jul 2019 16:54:52 +0100
parents 4077a625a01f
children f1216302bdef
files src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.hpp
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.hpp	Mon Jul 01 08:24:45 2019 -0400
+++ b/src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.hpp	Tue Jul 02 16:54:52 2019 +0100
@@ -57,7 +57,13 @@
 
 inline void OrderAccess::cross_modify_fence() {
   int idx = 0;
+#ifdef AMD64
   __asm__ volatile ("cpuid " : "+a" (idx) : : "ebx", "ecx", "edx", "memory");
+#else
+  // On some x86 systems EBX is a reserved register that cannot be
+  // clobbered, so we must protect it around the CPUID.
+  __asm__ volatile ("xchg %%esi, %%ebx; cpuid; xchg %%esi, %%ebx " : "+a" (idx) : : "esi", "ecx", "edx", "memory");
+#endif
 }
 
 template<>