Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.4(EOL)
-
None
Description
Older GCC incorrectly optimizes Bitmap<128> code by using SSE instructions on unaligned data.
Analysis, by vlad.lesin
The compiller error was found on Ubuntu 16.04, CentOS 6/7.
To optimize the work with Bitmap<128>::buffer[] compiller uses sse instructions.
For example, the following C++ code:
-------------
void intersect(Bitmap & map2)
-------------
is compilled into the following instructions:
-------------
movdqu xmm0,XMMWORD PTR [r12+0x28]
pand xmm0,XMMWORD PTR [rbx+0x28]
-------------
The second operand of 'pand' instruction must be alligned to 16, otherwise
exception occurs. But compiller generates the above instruction with
non-alligned second argument:
--------------
p ($rbx+0x28)%16
$20 = 8
--------------
There were also other instructions with non-alligned memory operand, for
example, 'por'.
Attachments
Issue Links
- relates to
-
MDEV-19734 investigate the performance effects of -O2 vs -O3 , possibly -O1 for gcc
- Open