mirror of
https://github.com/MariaDB/server.git
synced 2026-04-25 09:45:31 +02:00
MDEV-4786 merge 10.0-monty > 10.0
Workaround for a possible GCC bug happening in my_fill_ucs2: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58039 Commenting out the optimized loop. Using the original MySQL version. modified: strings/ctype-ucs2.c
This commit is contained in:
parent
3a1e8226e7
commit
4d15abf25a
1 changed files with 12 additions and 0 deletions
|
|
@ -3033,11 +3033,23 @@ static void
|
|||
my_fill_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
||||
char *s, size_t l, int fill)
|
||||
{
|
||||
DBUG_ASSERT(fill <= 0xFFFF);
|
||||
#ifdef WAITING_FOR_GCC_VECTORIZATION_BUG_TO_BE_FIXED
|
||||
/*
|
||||
This code with int2store() is known to be faster on some processors,
|
||||
but crashes on other processors due to a possible bug in GCC's
|
||||
-ftree-vectorization (which is enabled in -O3) in case of
|
||||
a non-aligned memory. See here for details:
|
||||
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58039
|
||||
*/
|
||||
char *last= s + l - 2;
|
||||
uint16 tmp= (fill >> 8) + ((fill & 0xFF) << 8); /* swap bytes */
|
||||
DBUG_ASSERT(fill <= 0xFFFF);
|
||||
for ( ; s <= last; s+= 2)
|
||||
int2store(s, tmp); /* store little-endian */
|
||||
#else
|
||||
for ( ; l >= 2; s[0]= (fill >> 8), s[1]= (fill & 0xFF), s+= 2, l-= 2);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue