ITADN

"GCC uses VMOVAPS/PD AVX instructions to access stack variables that are not 32-byte aligned"

#285ClosedMaximilianC 创建于 2026-01-04
M
MaximilianCcommented
I am using GCC 15.2.0 (with POSIX threads) + MinGW-w64 13.0.0 (UCRT) which seems to suffer from this almost 15 year old issue: [https://gcc.gnu.org/bugzilla/show_bug.cgi?format=multiple&id=49001](url) In summary, GCC may generate AVX load instructions which require 32 byte alignment, but the stack on Windows is only 16 byte aligned, causing the program to crash. This seems to have been fixed in MinGW-w64: https://github.com/msys2/MINGW-packages/pull/8317 It took me a while to find this issue in my program, and I have now worked around it by compiling with **-mno-avx**. I therefore recommend to add a remark under "Known Issues" on winlibs.com, that compiling with AVX enabled (nowadays enabled for most users when compiling with -march=native) will generate faulty code.
关闭于 2026-01-04 5 条评论