]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.2186: LTCG compile error ARM64 for write_chars v9.0.2186
authorSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 27 Dec 2023 17:57:12 +0000 (18:57 +0100)
committerChristian Brabandt <cb@256bit.org>
Wed, 27 Dec 2023 17:57:12 +0000 (18:57 +0100)
Problem:  LTCG compile error on Win/ARM64 for `write_chars()`
Solution: Explicitly initialise the storage to use data rather than BSS
          (Saleem Abdulrasool)

win32: add a workaround for a LTCG issue on Windows ARM64

It appears that the implicit initialisation which would push `g_coords`
into BSS causes an aliasing issue with LTCG on ARM64.  By explicitly
initialising the value, we use usual data storage but prevent the
aliasing.  This allows the console version of VIM to run on Windows
ARM64 again.

fixes:  #13453
closes: #13775

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/os_win32.c
src/version.c

index 2bf0fe712263d3f9c4f9fae9741bf32b7213fcab..e5cfac7294bde19bce991e15684cef6807d0ec37 100644 (file)
@@ -156,7 +156,10 @@ static HANDLE g_hConOut = INVALID_HANDLE_VALUE;
 
 // Win32 Screen buffer,coordinate,console I/O information
 static SMALL_RECT g_srScrollRegion;
-static COORD     g_coord;  // 0-based, but external coords are 1-based
+// This is explicitly initialised to work around a LTCG issue on Windows ARM64
+// (at least of 19.39.33321).  This pushes this into the `.data` rather than
+// `.bss` which corrects code generation in `write_chars` (#13453).
+static COORD     g_coord = {0, 0};  // 0-based, but external coords are 1-based
 
 // The attribute of the screen when the editor was started
 static WORD  g_attrDefault = 7;  // lightgray text on black background
index 986b174389dba5b74f2e2385afc86d2de49a3e1d..5446a5264e79bb9aa352d4f4113edc5d49725ee6 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2186,
 /**/
     2185,
 /**/