]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove support for 8 byte tear free read/write on 32-bit
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Mon, 18 May 2026 15:59:59 +0000 (08:59 -0700)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Mon, 18 May 2026 15:59:59 +0000 (08:59 -0700)
The macro for enabling single-copy atomicity on i586+ when using
GCC has been incorrect since 2017 (commit e8fdbd58f) without any
complaints, and getting it to work is non-trivial.

Getting this to work reliably require C11 atomics, which in turn
also bumps the required MSVC version. For now, simply remove the
attempted support which doesn't work anyways.

Author: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reported-by: Jakub Wartak <jakub.wartak@enterprisedb.com>
Suggested-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CAKZiRmycHOOJyEPc9FUss1_69_U62WoSx32jT7wyES-YkStZKA@mail.gmail.com
Discussion: https://posrgr.es/m/CA+hUKGKFvu3zyvv3aaj5hHs9VtWcjFAmisOwOc7aOZNc5AF3NA@mail.gmail.com

src/include/port/atomics/arch-x86.h

index bd6f4f56ca2cb9c552f175d8fb55d93cedd32f68..8cfe402c3393560c6ca525bb6e1c19ad11c22ebc 100644 (file)
@@ -236,11 +236,8 @@ pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_)
 #endif /* defined(__GNUC__) || defined(__INTEL_COMPILER) */
 
 /*
- * 8 byte reads / writes have single-copy atomicity on 32 bit x86 platforms
- * since at least the 586. As well as on all x86-64 cpus.
+ * 8 byte reads / writes have single-copy atomicity on all x86-64 cpus.
  */
-#if defined(__i568__) || defined(__i668__) || /* gcc i586+ */  \
-       (defined(_M_IX86) && _M_IX86 >= 500) || /* msvc i586+ */ \
-       defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) /* gcc, msvc */
+#if defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) /* gcc, msvc */
 #define PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY
 #endif /* 8 byte single-copy atomicity */