--- ghostscript-9.19/psi/iref.h.orig	2016-03-23 08:22:48.000000000 +0000
+++ ghostscript-9.19/psi/iref.h	2023-05-15 13:19:13.480181256 +0000
@@ -607,10 +607,19 @@
 
 /* Define the size of a ref. */
 #define ARCH_SIZEOF_REF sizeof(ref)
+
 /* Define the required alignment for refs. */
 /* We assume all alignment values are powers of 2. */
+/* SPARC and ARMv5 wants double-word load (64bit) aligned to */
+/* 8-byte boundary, so force aligned to 8 */
+#if defined(__sparc__) || (defined(__ARM_ARCH) && (__ARM_ARCH<=5)) 
+ #define ARCH_ALIGN_DWORD 8
+#else
+ #define ARCH_ALIGN_DWORD ARCH_ALIGN_LONG_MOD
+#endif
 #define ARCH_ALIGN_REF_MOD\
  (((ARCH_ALIGN_LONG_MOD - 1) | (ARCH_ALIGN_FLOAT_MOD - 1) |\
+   (ARCH_ALIGN_DWORD - 1) |\
    (ARCH_ALIGN_PTR_MOD - 1)) + 1)
 
 /* Select reasonable values for PDF interpreter */
