simde
simde copied to clipboard
gcc 11 with flags + i686 x86/{sse,sse2} test_simde_mm_cvt* failures
On the latest master branch commit: df63f88a364da6be3963b4924c327b12f88d7748
with gcc 11 with the following flags on Fedora rawhide (= 35), I faced the following failures. This failures do not happen with the gcc 11 without flags (no CFLAGS
and no CXXFLAGS
).
Could you take a look? Thanks.
+ gcc --version
gcc (GCC) 11.0.0 20210210 (Red Hat 11.0.0-0)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ g++ --version
g++ (GCC) 11.0.0 20210210 (Red Hat 11.0.0-0)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ CC='gcc -fno-strict-aliasing'
+ CXX='g++ -fno-strict-aliasing'
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ meson setup build/gcc-with-flags
+ ninja -C build/gcc-with-flags -v -j 4
+ meson test -C build/gcc-with-flags -q --no-rebuild --print-errorlogs
▶ 289/882 sse/mm_cvt_ps2pi FAIL
▶ 289/882 sse/mm_cvtps_pi16 FAIL
▶ 290/882 sse/mm_cvtsi64_ss FAIL
▶ 291/882 sse/mm_cvt_ps2pi FAIL
▶ 291/882 sse/mm_cvtps_pi16 FAIL
▶ 292/882 sse/mm_cvtsi64_ss FAIL
▶ 293/882 sse2/mm_cvtsd_si64 FAIL
▶ 294/882 sse2/mm_cvtsd_si64 FAIL
289/882 x86/sse/emul/c ERROR 0.37s exit status 1
>>> MALLOC_PERTURB_=83 /builddir/build/BUILD/simde-df63f88a364da6be3963b4924c327b12f88d7748/build/gcc-with-flags/test/x86/sse-emul-c
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
../../test/x86/sse.c:2122: assertion failed: r[0] == test_vec[i].r[0] (-2147483648 == -974)
../../test/x86/sse.c:2408: assertion failed: r[0] == e[0] (0 == 318)
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
290/882 x86/sse/native/c ERROR 0.37s exit status 1
>>> MALLOC_PERTURB_=247 /builddir/build/BUILD/simde-df63f88a364da6be3963b4924c327b12f88d7748/build/gcc-with-flags/test/x86/sse-native-c
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
../../test/x86/sse.c:2633: assertion failed: r[0] ~= test_vec[i].r[0] (-nan ~= -400.000000)
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
291/882 x86/sse/emul/cpp ERROR 0.37s exit status 1
>>> MALLOC_PERTURB_=214 /builddir/build/BUILD/simde-df63f88a364da6be3963b4924c327b12f88d7748/build/gcc-with-flags/test/x86/sse-emul-cpp
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
test/x86/sse.cpp:2122: assertion failed: r[0] == test_vec[i].r[0] (-2147483648 == -974)
test/x86/sse.cpp:2408: assertion failed: r[0] == e[0] (0 == 318)
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
292/882 x86/sse/native/cpp ERROR 0.37s exit status 1
>>> MALLOC_PERTURB_=33 /builddir/build/BUILD/simde-df63f88a364da6be3963b4924c327b12f88d7748/build/gcc-with-flags/test/x86/sse-native-cpp
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
test/x86/sse.cpp:2633: assertion failed: r[0] ~= test_vec[i].r[0] (-nan ~= -400.000000)
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
293/882 x86/sse2/native/c ERROR 0.36s exit status 1
>>> MALLOC_PERTURB_=115 /builddir/build/BUILD/simde-df63f88a364da6be3963b4924c327b12f88d7748/build/gcc-with-flags/test/x86/sse2-native-c
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
../../test/x86/sse2.c:3382: assertion failed: r == test_vec[i].r (-9223372036854775808 == -309)
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
294/882 x86/sse2/native/cpp ERROR 0.36s exit status 1
>>> MALLOC_PERTURB_=218 /builddir/build/BUILD/simde-df63f88a364da6be3963b4924c327b12f88d7748/build/gcc-with-flags/test/x86/sse2-native-cpp
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
test/x86/sse2.cpp:3382: assertion failed: r == test_vec[i].r (-9223372036854775808 == -309)
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Summary of Failures:
289/882 x86/sse/emul/c ERROR 0.37s exit status 1
290/882 x86/sse/native/c ERROR 0.37s exit status 1
291/882 x86/sse/emul/cpp ERROR 0.37s exit status 1
292/882 x86/sse/native/cpp ERROR 0.37s exit status 1
293/882 x86/sse2/native/c ERROR 0.36s exit status 1
294/882 x86/sse2/native/cpp ERROR 0.36s exit status 1
Ok: 876
Expected Fail: 0
Fail: 6
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Full log written to /builddir/build/BUILD/simde-df63f88a364da6be3963b4924c327b12f88d7748/build/gcc-with-flags/meson-logs/testlog.txt
This failures also do not happen with the gcc 11 + only -O2 flags (CFLAGS="-O2" CXXFLAGS="-O2").
This failures also do not happen with the gcc 11 + only -O2 flags (CFLAGS="-O2" and no CXXFLAGS="-O2").
They don't? i686 is a mess on my system, even without any optimization flags. Maybe because I'm just running the i686 executables on an x86_64 system… I'll have to try installing an i686 VM to see if it's any different.
Yes, they don't. OK. I will share the full log of the 2 cases (-O2 + other flags vs only -O2) later.
Here is the full-log by building the simde RPM spec file.
In the result log,
- The test case "=== 1.2. tests on gcc with O2 flag ===" is with only -O2 flag.
- The test case "=== 1.3. tests on gcc with flags macro ===" is with -O2 + other flags.
You can see only the "1.3" shows the failures.
I noticed in the above full-log by the builds, which I executed on minutes ago, the gcc version is 11.0.1
, not 11.0.0
.
+ gcc --version
gcc (GCC) 11.0.1 20210324 (Red Hat 11.0.1-0)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ g++ --version
g++ (GCC) 11.0.1 20210324 (Red Hat 11.0.1-0)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
On latest master commit 48edfa906d835525e2061fbf6062b7c326d66840
on Fedora rawhide (35), gcc 11.1.1 with flags, i686, I still see this issue. Just in case I would share the log.
== 1. tests on gcc ==
+ gcc --version
gcc (GCC) 11.1.1 20210623 (Red Hat 11.1.1-6)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ g++ --version
g++ (GCC) 11.1.1 20210623 (Red Hat 11.1.1-6)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
=== 1.3. tests on gcc with flags macro ===
+ BUILD_DIR=build/gcc-flags-macro
+ CC='gcc -fno-strict-aliasing'
+ CXX='g++ -fno-strict-aliasing'
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ _setup
+ meson setup build/gcc-flags-macro
The Meson build system
Version: 0.58.0
Source dir: /builddir/build/BUILD/simde-48edfa906d835525e2061fbf6062b7c326d66840
Build dir: /builddir/build/BUILD/simde-48edfa906d835525e2061fbf6062b7c326d66840/build/gcc-flags-macro
Build type: native build
Project name: SIMDe
Project version: 0.7.3
C compiler for the host machine: gcc -fno-strict-aliasing (gcc 11.1.1 "gcc (GCC) 11.1.1 20210623 (Red Hat 11.1.1-6)")
C linker for the host machine: gcc -fno-strict-aliasing ld.bfd 2.36.1-15
C++ compiler for the host machine: g++ -fno-strict-aliasing (gcc 11.1.1 "g++ (GCC) 11.1.1 20210623 (Red Hat 11.1.1-6)")
C++ linker for the host machine: g++ -fno-strict-aliasing ld.bfd 2.36.1-15
Host machine cpu family: x86
Host machine cpu: i686
Library m found: YES
Compiler for C supports arguments -fopenmp-simd: YES
Compiler for C++ supports arguments -fopenmp-simd: YES
Compiler for C supports arguments -Wpsabi: YES
Compiler for C++ supports arguments -Wpsabi: YES
Library m found: YES
Build targets in project: 1442
Found ninja-1.10.2 at /usr/bin/ninja
+ _build
+ rm -f build.log
+ _time ninja -C build/gcc-flags-macro -v -j 6
+ head -4 build.log
+ /usr/bin/time -f '=> [%E]' ninja -C build/gcc-flags-macro -v -j 6
ninja: Entering directory `build/gcc-flags-macro'
[1/2884] gcc -fno-strict-aliasing -Itest/common/common-c.p -Itest/common -I../../test/common -I. -I../.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -g -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fopenmp-simd -DSIMDE_CONSTRAINED_COMPILATION -DSIMDE_ENABLE_OPENMP -Wno-psabi -DSIMDE_TEST_BARE -MD -MQ test/common/common-c.p/common.c.o -MF test/common/common-c.p/common.c.o.d -o test/common/common-c.p/common.c.o -c ../../test/common/common.c
[2/2884] gcc -fno-strict-aliasing -o test/common/common-c test/common/common-c.p/common.c.o -Wl,--as-needed -Wl,--no-undefined -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,--start-group -lm -Wl,--end-group
+ tail -3 build.log
[2883/2884] g++ -fno-strict-aliasing -o test/mips/msa/subv-emul-cpp test/mips/msa/subv-emul-cpp.p/meson-generated_.._subv.cpp.o -Wl,--as-needed -Wl,--no-undefined -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,--start-group -lm -Wl,--end-group
[2884/2884] g++ -fno-strict-aliasing -o test/mips/msa/subv-native-cpp test/mips/msa/subv-native-cpp.p/meson-generated_.._subv.cpp.o -Wl,--as-needed -Wl,--no-undefined -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,--start-group -lm -Wl,--end-group
=> [10:53.21]
+ _test
+ _time meson test -C build/gcc-flags-macro -q --no-rebuild --print-errorlogs
+ /usr/bin/time -f '=> [%E]' meson test -C build/gcc-flags-macro -q --no-rebuild --print-errorlogs
▶ 391/1442 sse/mm_cvt_ps2pi FAIL
▶ 391/1442 sse/mm_cvtps_pi16 FAIL
▶ 392/1442 sse/mm_cvtsi64_ss FAIL
391/1442 x86/sse/emul/c ERROR 0.05s exit status 1
>>> MALLOC_PERTURB_=8 /builddir/build/BUILD/simde-48edfa906d835525e2061fbf6062b7c326d66840/build/gcc-flags-macro/test/x86/sse-emul-c
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
../../test/x86/sse.c:2122: assertion failed: r[0] == test_vec[i].r[0] (-2147483648 == -974)
../../test/x86/sse.c:2408: assertion failed: r[0] == e[0] (0 == 318)
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
392/1442 x86/sse/native/c ERROR 0.05s exit status 1
>>> MALLOC_PERTURB_=218 /builddir/build/BUILD/simde-48edfa906d835525e2061fbf6062b7c326d66840/build/gcc-flags-macro/test/x86/sse-native-c
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
../../test/x86/sse.c:2633: assertion failed: r[0] ~= test_vec[i].r[0] (-nan ~= -400.000000)
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
▶ 397/1442 sse/mm_cvt_ps2pi FAIL
▶ 397/1442 sse/mm_cvtps_pi16 FAIL
▶ 398/1442 sse/mm_cvtsi64_ss FAIL
▶ 399/1442 sse2/mm_cvtsd_si64 FAIL
▶ 400/1442 sse2/mm_cvtsd_si64 FAIL
397/1442 x86/sse/emul/cpp ERROR 0.06s exit status 1
>>> MALLOC_PERTURB_=233 /builddir/build/BUILD/simde-48edfa906d835525e2061fbf6062b7c326d66840/build/gcc-flags-macro/test/x86/sse-emul-cpp
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
test/x86/sse.cpp:2122: assertion failed: r[0] == test_vec[i].r[0] (-2147483648 == -974)
test/x86/sse.cpp:2408: assertion failed: r[0] == e[0] (0 == 318)
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
398/1442 x86/sse/native/cpp ERROR 0.06s exit status 1
>>> MALLOC_PERTURB_=190 /builddir/build/BUILD/simde-48edfa906d835525e2061fbf6062b7c326d66840/build/gcc-flags-macro/test/x86/sse-native-cpp
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
test/x86/sse.cpp:2633: assertion failed: r[0] ~= test_vec[i].r[0] (-nan ~= -400.000000)
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
399/1442 x86/sse2/native/c ERROR 0.06s exit status 1
>>> MALLOC_PERTURB_=38 /builddir/build/BUILD/simde-48edfa906d835525e2061fbf6062b7c326d66840/build/gcc-flags-macro/test/x86/sse2-native-c
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
../../test/x86/sse2.c:3382: assertion failed: r == test_vec[i].r (-9223372036854775808 == -309)
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
400/1442 x86/sse2/native/cpp ERROR 0.07s exit status 1
>>> MALLOC_PERTURB_=126 /builddir/build/BUILD/simde-48edfa906d835525e2061fbf6062b7c326d66840/build/gcc-flags-macro/test/x86/sse2-native-cpp
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
test/x86/sse2.cpp:3382: assertion failed: r == test_vec[i].r (-9223372036854775808 == -309)
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Summary of Failures:
391/1442 x86/sse/emul/c ERROR 0.05s exit status 1
392/1442 x86/sse/native/c ERROR 0.05s exit status 1
397/1442 x86/sse/emul/cpp ERROR 0.06s exit status 1
398/1442 x86/sse/native/cpp ERROR 0.06s exit status 1
399/1442 x86/sse2/native/c ERROR 0.06s exit status 1
400/1442 x86/sse2/native/cpp ERROR 0.07s exit status 1
Ok: 1436
Expected Fail: 0
Fail: 6
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Full log written to /builddir/build/BUILD/simde-48edfa906d835525e2061fbf6062b7c326d66840/build/gcc-flags-macro/meson-logs/testlog.txt
Command exited with non-zero status 6
=> [0:09.06]
I just skipped the failures by the following commands in the case.
+ sed -i '/^test_simde_mm_cvt_ps2pi *(/,/^}$/ s|simde_test_x86_assert_equal_i32x2|//\0|' test/x86/sse.c
+ sed -i '/^test_simde_mm_cvtps_pi16 *(/,/^}$/ s|simde_test_x86_assert_equal_i16x4|//\0|' test/x86/sse.c
+ sed -i '/^test_simde_mm_cvtsi64_ss *(/,/^}$/ s|simde_test_x86_assert_equal_f32x4|//\0|' test/x86/sse.c
+ sed -i '/^test_simde_mm_cvtsd_si64 *(/,/^}$/ s|simde_assert_equal_i64|//\0|' test/x86/sse2.c
+ sed -i '/^test_simde_mm_cvtsi64_sd *(/,/^}$/ s|simde_assert_m128d_close|//\0|' test/x86/sse2.c
+ sed -i '/^test_simde_mm_cvttsd_si64 *(/,/^}$/ s|simde_assert_equal_i64|//\0|' test/x86/sse2.c
@junaruga can you re-run your tests against the latest code?
Would be nice to have a Dockefile that reproduced this
Thanks!
Sure! Let me do it when i have time.