Commit 40ff8019 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-19709 Bitmap<128>::merge etc may crash on older GCC versions

Older GCC generates SSE instruction on not-128-bit-aligned data in
Bitmap<128>::buffer

Workaround by forcing GCC not to use SSE on Bitmap<N> template.
parent be5c432a
......@@ -27,6 +27,18 @@
#include <my_bitmap.h>
#include <my_bit.h>
/*
Workaround GCC optimizer bug (generating SSE instuctions on unaligned data)
*/
#if defined (__GNUC__) && defined(__x86_64__) && (__GNUC__ < 6)
#define NEED_GCC_NO_SSE_WORKAROUND
#endif
#ifdef NEED_GCC_NO_SSE_WORKAROUND
#pragma GCC push_options
#pragma GCC target ("no-sse")
#endif
template <uint width> class Bitmap
{
uint32 buffer[(width + 31) / 32];
......@@ -266,6 +278,11 @@ template <uint width> class Bitmap
};
};
#ifdef NEED_GCC_NO_SSE_WORKAROUND
#pragma GCC pop_options
#undef NEED_GCC_NO_SSE_WORKAROUND
#endif
/* An iterator to quickly walk over bits in ulonglong bitmap. */
class Table_map_iterator
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment