Subject: bug#29040: Emacs 25 hangs on windows arbitrarily during search of a unicode file

From: Paul Eggert <[email-masked]>
Date: Fri, 3 Nov 2017 02:25:17 -0700

Eli Zaretskii wrote:
>    globals.h:1095:10: error: requested alignment is not an integer constant
>       struct Lisp_Symbol GCALIGNED s;
> 	    ^

Ouch, I had thought that only older MSVC had the problem. Sorry about that. I 
installed the attached into emacs-26 and merged it to master.
>From c911b27aff8dd15cd47a063dc958e6dae74dde06 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Fri, 3 Nov 2017 02:20:15 -0700
Subject: [PATCH] Change GCALIGNMENT back to an integer literal

* src/lisp.h (GCALIGNMENT): Change it back to a macro
that expands to a literal integer constant, for older GCC.
I had mistakenly thought that only MSVC had the problem.
Problem repored by Eli Zaretskii (Bug#29040#69).
---
 src/lisp.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/lisp.h b/src/lisp.h
index a71ba22..4dd4720 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -233,7 +233,9 @@ extern bool suppress_checking EXTERNALLY_VISIBLE;
 
 enum Lisp_Bits
   {
-    GCALIGNMENT = 1 << GCTYPEBITS,
+    /* 2**GCTYPEBITS.  This must be a macro that expands to a literal
+       integer constant, for older versions of GCC (through at least 4.9).  */
+#define GCALIGNMENT 8
 
     /* Number of bits in a Lisp_Object value, not counting the tag.  */
     VALBITS = EMACS_INT_WIDTH - GCTYPEBITS,
@@ -245,6 +247,10 @@ enum Lisp_Bits
     FIXNUM_BITS = VALBITS + 1
   };
 
+#if GCALIGNMENT != 1 << GCTYPEBITS
+# error "GCALIGNMENT and GCTYPEBITS are inconsistent"
+#endif
+
 /* The maximum value that can be stored in a EMACS_INT, assuming all
    bits other than the type bits contribute to a nonnegative signed value.
    This can be used in #if, e.g., '#if USE_LSB_TAG' below expands to an
-- 
2.7.4