Commit 009dee83 authored by Sergei Golubchik's avatar Sergei Golubchik

centos5 gcc 4.1 asm bug

include/atomic/x86-gcc.h:
  force %esi register, don't give gcc a choice.
  (otherwise it could choose %ebx, and 4.1 did)
parent e0a08c56
...@@ -47,9 +47,3 @@ IF(HAVE_DECL_SHM_HUGETLB) ...@@ -47,9 +47,3 @@ IF(HAVE_DECL_SHM_HUGETLB)
SET(HAVE_LARGE_PAGE_OPTION 1) SET(HAVE_LARGE_PAGE_OPTION 1)
ENDIF() ENDIF()
IF(CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR MATCHES "86")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=i686")
ENDIF()
...@@ -124,10 +124,10 @@ ...@@ -124,10 +124,10 @@
asm volatile ("push %%ebx;" \ asm volatile ("push %%ebx;" \
"movl (%%ecx), %%ebx;" \ "movl (%%ecx), %%ebx;" \
"movl 4(%%ecx), %%ecx;" \ "movl 4(%%ecx), %%ecx;" \
LOCK_prefix "; cmpxchg8b %0;" \ LOCK_prefix "; cmpxchg8b (%%esi);" \
"setz %2; pop %%ebx" \ "setz %2; pop %%ebx" \
: "=m" (*a), "+A" (*cmp), "=c" (ret) \ : "+S" (a), "+A" (*cmp), "=c" (ret) \
: "c" (&set), "m" (*a) \ : "c" (&set) \
: "memory", "esp") : "memory", "esp")
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment