libgcc: Fix __gthr_i486_lock_cmp_xchg clobber for Windows
2022-01-14 David <gccbugzilla@limegreensocks.com> libgcc/ * config/i386/gthr-win32.c (__gthr_i486_lock_cmp_xchg): Remove inlined version, Windows 95 is no longer relevant. * config/i386/gthr-win32.h (__GTHREAD_I486_INLINE_LOCK_PRIMITIVES): unset.
This commit is contained in:
parent
617db51d7e
commit
dcf8fe1eea
2 changed files with 2 additions and 23 deletions
|
@ -31,8 +31,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||||
#ifndef __GTHREAD_HIDE_WIN32API
|
#ifndef __GTHREAD_HIDE_WIN32API
|
||||||
# define __GTHREAD_HIDE_WIN32API 1
|
# define __GTHREAD_HIDE_WIN32API 1
|
||||||
#endif
|
#endif
|
||||||
#undef __GTHREAD_I486_INLINE_LOCK_PRIMITIVES
|
|
||||||
#define __GTHREAD_I486_INLINE_LOCK_PRIMITIVES
|
|
||||||
#include "gthr-win32.h"
|
#include "gthr-win32.h"
|
||||||
|
|
||||||
/* Windows32 threads specific definitions. The windows32 threading model
|
/* Windows32 threads specific definitions. The windows32 threading model
|
||||||
|
|
|
@ -374,28 +374,9 @@ extern int _CRT_MT;
|
||||||
extern int __mingwthr_key_dtor (unsigned long, void (*) (void *));
|
extern int __mingwthr_key_dtor (unsigned long, void (*) (void *));
|
||||||
#endif /* _WIN32 && !__CYGWIN__ */
|
#endif /* _WIN32 && !__CYGWIN__ */
|
||||||
|
|
||||||
/* The Windows95 kernel does not export InterlockedCompareExchange.
|
/* __GTHR_W32_InterlockedCompareExchange is left over from win95,
|
||||||
This provides a substitute. When building apps that reference
|
which did not support InterlockedCompareExchange. */
|
||||||
gthread_mutex_try_lock, the __GTHREAD_I486_INLINE_LOCK_PRIMITIVES
|
|
||||||
macro must be defined if Windows95 is a target. Currently
|
|
||||||
gthread_mutex_try_lock is not referenced by libgcc or libstdc++. */
|
|
||||||
#ifdef __GTHREAD_I486_INLINE_LOCK_PRIMITIVES
|
|
||||||
static inline long
|
|
||||||
__gthr_i486_lock_cmp_xchg(long *__dest, long __xchg, long __comperand)
|
|
||||||
{
|
|
||||||
long result;
|
|
||||||
__asm__ __volatile__ ("\n\
|
|
||||||
lock\n\
|
|
||||||
cmpxchg{l} {%4, %1|%1, %4}\n"
|
|
||||||
: "=a" (result), "=m" (*__dest)
|
|
||||||
: "0" (__comperand), "m" (*__dest), "r" (__xchg)
|
|
||||||
: "cc");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
#define __GTHR_W32_InterlockedCompareExchange __gthr_i486_lock_cmp_xchg
|
|
||||||
#else /* __GTHREAD_I486_INLINE_LOCK_PRIMITIVES */
|
|
||||||
#define __GTHR_W32_InterlockedCompareExchange InterlockedCompareExchange
|
#define __GTHR_W32_InterlockedCompareExchange InterlockedCompareExchange
|
||||||
#endif /* __GTHREAD_I486_INLINE_LOCK_PRIMITIVES */
|
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
__gthread_active_p (void)
|
__gthread_active_p (void)
|
||||||
|
|
Loading…
Add table
Reference in a new issue