The none/tests/x86/sse4-x86 fails when valgrind is compiled with clang.
With default clang -O2 (which involves the slp-vectorizer optimization)
this test code translates to assembly involving MOVDQA. That's a SIMD
instruction requiring explicitly aligned memory.
Turns out that the required 16-byte stack alignment isn't in place by
default. This instruction ends up with a GP, so that Valgrind ends up
with segmentation fault.
To fix this, the affected clean helper function g_calc_mpsadbw() is
now compiled with the 'force_align_arg_pointer' attribute, making sure
the needed stack alignment is in place. Both GCC and clang accept
this attribute.
https://bugs.kde.org/show_bug.cgi?id=523626
522160 Robustify the flags check in the none/tests/x86/crc32 test
522533 Valgrind can't handle some encoding from gas trunk with -Wa,-O2
523375 Fix none/tests/amd64/pcmpxstrx64.c
+523626 Fix sse4-x86 test fails when valgrind compiled with clang
To see details of a given bug, visit
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
}
/* CALLED FROM GENERATED CODE: CLEAN HELPER */
-static inline ULong g_calc_mpsadbw ( ULong sHi, ULong sLo,
- ULong dHi, ULong dLo,
- ULong imm_and_return_control_bit )
+#if defined(VGA_x86)
+// Handle https://bugs.kde.org/show_bug.cgi?id=523626
+__attribute__((force_align_arg_pointer))
+#endif
+static ULong g_calc_mpsadbw ( ULong sHi, ULong sLo,
+ ULong dHi, ULong dLo,
+ ULong imm_and_return_control_bit )
{
UInt imm8 = imm_and_return_control_bit & 7;
Bool calcHi = (imm_and_return_control_bit >> 7) & 1;