MSYS2-packages: Investigation into the mingw-w64 AVX AND AVX2 misalignment bug.
Hello.
Please upgrade the following setups from msys2 home page:
msys2-i686-20161025.exe
msys2-x86_64-20161025.exe
This will prevent beginners from thinking that the project was left in 2016.
Thank you!
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 27 (11 by maintainers)
FWIW, all of this is very much unrelated to the original issue, while this thread now is hijacked for a completely different matter.
As mentioned in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412, clang and MSVC don’t seem to have the same issue. An adjusted version of the example code,
avxalign.c
:If compiled with GCC:
This doesn’t align the pointer where the argument is stored, and writes into it with
vmovaps
.With clang:
This overallocates stack space in order to be able to align it, and then writes into it with an aligned write.
If not using SEH, by adding
-fdwarf-exceptions
, it produces different code that also does the alignment:This is what MSVC produces:
This both aligns the pointer, and uses unaligned stores to write it onto the stack
However, this only seems to be an issue when passing such variables by value. Local variables seem to be properly aligned even with GCC:
Here the local variable is properly aligned.