Skip to content

Commit

Permalink
x86: Disable AVX support on 64-bit MinGW
Browse files Browse the repository at this point in the history
GCC for 64-bit Windows has a bug that it fails to properly re-align the
stack pointer for use with 256-bit memory addresses (AVX). Therefore,
there's about a 50/50 chance that any function using AVX will have an
improperly-aligned stack. In release mode, stack accesses should be
rare, but in debug mode they happen frequently. Either way, this is a
ticking time bomb, so we disable.

Clang is not affected.
32-bit MinGW is not affected.
64-bit in other OSes with GCC are not affected.

Fixes: QTBUG-73539
Change-Id: Id061f35c088044b69a15fffd1580967808f31671
Reviewed-by: Allan Sandfeld Jensen <[email protected]>
  • Loading branch information
thiagomacieira committed Feb 6, 2019
1 parent b319d14 commit 37352b2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config.tests/x86_simd/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ attribute_target("sha") void test_shani()
#endif

#if T(AVX)
# if defined(__WIN64__) && defined(__GNUC__) && !defined(__clang__)
# error "AVX support is broken in 64-bit MinGW - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49001"
# endif
attribute_target("avx") void test_avx()
{
__m256d a = _mm256_setzero_pd();
Expand Down

0 comments on commit 37352b2

Please sign in to comment.