diff options
author | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2022-01-31 22:45:37 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-02-03 17:54:35 +0100 |
commit | 3f96d70ce7f31d556b995733b44cb8715b64e329 (patch) | |
tree | 88872c80e2c0174a2fe7b39b2028828f2aa74fe1 | |
parent | d036ea9651c05a2a50794bc5c0ee7ea54708ad6a (diff) |
Avoid calling AVX code in library static initialization
Despite 26072b8db7ba53f00c83197cb064229a76001989 and
12c6b1ef6a824b09778163ec83fc44bb196e65db, Linux builds using
RH devtoolset-7 gcc7 still hit occasional unit test crashes
with illegal instructions.
Backtrace is always:
> #0 __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at core/sc/source/core/tool/arraysumAVX.cxx:20
> #1 _GLOBAL__sub_I_arraysumAVX.cxx(void) () at core/sc/source/core/tool/arraysumAVX.cxx:112
>
So lets make sure initializer is run only on function entry.
Change-Id: I69f5cb725e4d72fb346166b21870612473f974b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129246
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
(cherry picked from commit d140817428cdbb519efa496f578bf6c054c94361)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129251
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sc/source/core/tool/arraysumAVX.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/tool/arraysumAVX.cxx b/sc/source/core/tool/arraysumAVX.cxx index e256248047d0..4d9ee02285e7 100644 --- a/sc/source/core/tool/arraysumAVX.cxx +++ b/sc/source/core/tool/arraysumAVX.cxx @@ -30,7 +30,7 @@ using namespace AVX; */ static inline void sumAVX(__m256d& sum, __m256d& err, const __m256d& value) { - const __m256d ANNULATE_SIGN_BIT + static const __m256d ANNULATE_SIGN_BIT = _mm256_castsi256_pd(_mm256_set1_epi64x(0x7FFF'FFFF'FFFF'FFFF)); // Temporal parameter __m256d t = _mm256_add_pd(sum, value); |