Skip to content

Commit 38bea30

Browse files
compnerdchrisbra
authored andcommitted
patch 9.0.2186: LTCG compile error ARM64 for write_chars
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>
1 parent 65672ae commit 38bea30

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/os_win32.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ static HANDLE g_hConOut = INVALID_HANDLE_VALUE;
156156

157157
// Win32 Screen buffer,coordinate,console I/O information
158158
static SMALL_RECT g_srScrollRegion;
159-
static COORD g_coord; // 0-based, but external coords are 1-based
159+
// This is explicitly initialised to work around a LTCG issue on Windows ARM64
160+
// (at least of 19.39.33321). This pushes this into the `.data` rather than
161+
// `.bss` which corrects code generation in `write_chars` (#13453).
162+
static COORD g_coord = {0, 0}; // 0-based, but external coords are 1-based
160163

161164
// The attribute of the screen when the editor was started
162165
static WORD g_attrDefault = 7; // lightgray text on black background

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
2186,
707709
/**/
708710
2185,
709711
/**/

0 commit comments

Comments
 (0)