diff -wu a/win32/vmem.h b/win32/vmem.h
--- a/win32/vmem.h 2022-06-21 03:57:59.000000000 +1000
+++ b/win32/vmem.h 2022-07-21 02:30:13.000000000 +1000
@@ -69,14 +69,32 @@
#ifdef _USE_LINKED_LIST
class VMem;
+
+/*
+ * Address an alignment issue with x64 mingw-w64 ports of gcc-12 and
+ * (presumably) later. We do the same thing again 16 lines further down.
+ * See https://github.com/Perl/perl5/issues/19824
+ */
+
+#if defined(__MINGW64__) && __GNUC__ > 11
+typedef struct _MemoryBlockHeader* PMEMORY_BLOCK_HEADER __attribute__ ((aligned(16)));
+#else
typedef struct _MemoryBlockHeader* PMEMORY_BLOCK_HEADER;
+#endif
+
typedef struct _MemoryBlockHeader {
PMEMORY_BLOCK_HEADER pNext;
PMEMORY_BLOCK_HEADER pPrev;
VMem *owner;
+
+#if defined(__MINGW64__) && __GNUC__ > 11
+} MEMORY_BLOCK_HEADER __attribute__ ((aligned(16))), *PMEMORY_BLOCK_HEADER;
+#else
} MEMORY_BLOCK_HEADER, *PMEMORY_BLOCK_HEADER;
#endif
+#endif
+
class VMem
{
public: