Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: simde tests started failing after clang was upgraded from 19.1.7 to 20.1.0. They're still failing with 20.1.3. Version-Release number of selected component (if applicable): clang-20.1.3-1.fc43 How reproducible: Always. Steps to Reproduce: 1. koji build --nowait --scratch rawhide git+https://src.fedoraproject.org/rpms/simde.git#cf07922a6ed8fe2d13482afa862e68b2ecc53385 Actual results: + /bin/time -f '=> [%E]' meson test -C build/clang-rpm -q --no-rebuild --print-errorlogs ▶ 961/2002 mul_lane/vmul_laneq_s32 FAIL ▶ 962/2002 mul_lane/vmul_laneq_s32 FAIL 961/2002 arm/neon/mul_lane/emul/c ERROR 1.49s exit status 1 >>> MESON_TEST_ITERATION=1 MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=156 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 /builddir/build/BUILD/simde-0.8.2-build/simde-0.8.2/build/clang-rpm/test/arm/neon/mul_lane-emul-c ――――――――――――――――――――――――――――――――――――― ✀ ――――――――――――――――――――――――――――――――――――― stderr: ../../test/arm/neon/mul_lane.c:599: assertion failed: r[0] == simde_vld1_s32(test_vec[i].r)[0] (2076856 == 2076856) (test program exited with status code 1) ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 962/2002 arm/neon/mul_lane/emul/cpp ERROR 1.46s exit status 1 >>> MESON_TEST_ITERATION=1 MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=128 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 /builddir/build/BUILD/simde-0.8.2-build/simde-0.8.2/build/clang-rpm/test/arm/neon/mul_lane-emul-cpp ――――――――――――――――――――――――――――――――――――― ✀ ――――――――――――――――――――――――――――――――――――― stderr: test/arm/neon/mul_lane.cpp:599: assertion failed: r[0] == simde_vld1_s32(test_vec[i].r)[0] (2076856 == 2076856) (test program exited with status code 1) ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― Summary of Failures: 961/2002 arm/neon/mul_lane/emul/c ERROR 1.49s exit status 1 962/2002 arm/neon/mul_lane/emul/cpp ERROR 1.46s exit status 1 Ok: 2000 Expected Fail: 0 Fail: 2 Unexpected Pass: 0 Skipped: 0 Timeout: 0 Full log written to /builddir/build/BUILD/simde-0.8.2-build/simde-0.8.2/build/clang-rpm/meson-logs/testlog.txt Command exited with non-zero status 2 => [0:31.39] Expected results: + /bin/time -f '=> [%E]' meson test -C build/clang-rpm -q --no-rebuild --print-errorlogs Ok: 2002 Expected Fail: 0 Fail: 0 Unexpected Pass: 0 Skipped: 0 Timeout: 0 Full log written to /builddir/build/BUILD/simde-0.8.2-build/simde-0.8.2/build/clang-rpm/meson-logs/testlog.txt => [0:27.17]
Still reproduces when using clang 20.1.5.
I'll take a look at this one.
I looked into this a bit yesterday and extracted this standalone reproducer: https://gist.github.com/nikic/08992eee1acb69d84cc75682ffe7ae4f The issue requires ThinLTO to reproduce and opt-bisect points to LoopFullUnroll, but that's most likely a red herring.
@npopov I've bisected it to https://github.com/llvm/llvm-project/commit/fe182ddf1f3daf55a86bbabeff40dda109bbbe91
This is a bug in simde. https://github.com/simd-everywhere/simde/blob/51743e7920b6e867678cb50e9c62effe28f70b33/simde/arm/neon/mul_lane.h#L389 (and various other places) performs C signed integer multiplication, which is UB on overflow. These intrinsics are not supposed to have UB on overflow. The issue was exposed because the loop was unrolled and all the constants were propagated. I confirmed that adding (unsigned) casts to the code fixes the issue.
Filed upstream issue: https://github.com/simd-everywhere/simde/issues/1295
*** Bug 2368547 has been marked as a duplicate of this bug. ***