Skip to content

Commit b5ea5e0

Browse files
author
Brian Barrett
committed
* Some recent versions of GCC try very hard to make it impossible to
use ebx in inline assembly. For the beta, just don't inline the 64 bit atomic compare and swap on IA32 (cmpxchg8 requires use of ebx). Any caller of the function will fall back to the non-inline version. This commit was SVN r5957.
1 parent ec7aa4f commit b5ea5e0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/include/sys/ia32/atomic.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ static inline int ompi_atomic_cmpset_32(volatile int32_t *addr,
102102

103103
#if OMPI_GCC_INLINE_ASSEMBLY
104104

105+
#if 0
106+
107+
/* some versions of GCC won't let you use ebx period (even though they
108+
should be able to save / restore for the life of the inline
109+
assembly). For the beta, just use the non-inline version */
110+
105111
#ifndef ll_low /* GLIBC provides these somewhere, so protect */
106112
#define ll_low(x) *(((unsigned int*)&(x))+0)
107113
#define ll_high(x) *(((unsigned int*)&(x))+1)
@@ -135,6 +141,7 @@ static inline int ompi_atomic_cmpset_64(volatile int64_t *addr,
135141
: "cc", "memory", "ebx");
136142
return (int) ret;
137143
}
144+
#endif /* if 0 */
138145

139146
#endif /* OMPI_GCC_INLINE_ASSEMBLY */
140147

0 commit comments

Comments
 (0)