[clang] [Clang] Fix assertion "unsigned range includes negative?" in AnalyzeComparison during Sema of vector comparison with mismatched signed/unsigned types and __builtin_convertvector (PR #182627)

LLVM Continuous Integration via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 22 06:12:15 PDT 2026


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-ubuntu-fast` running on `sie-linux-worker` while building `clang` at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/65949

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: Sema/compare.c' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/lib/clang/include -nostdsysteminc -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -Wtautological-constant-in-range-compare /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c -Wno-unreachable-code -fenable-matrix -DTEST=1
# executed command: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/lib/clang/include -nostdsysteminc -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -Wtautological-constant-in-range-compare /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c -Wno-unreachable-code -fenable-matrix -DTEST=1
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/lib/clang/include -nostdsysteminc -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -Wtype-limits /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c -Wno-unreachable-code -fenable-matrix -DTEST=2
# executed command: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/lib/clang/include -nostdsysteminc -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -Wtype-limits /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c -Wno-unreachable-code -fenable-matrix -DTEST=2
# note: command had no output on stdout or stderr
# RUN: at line 3
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/lib/clang/include -nostdsysteminc -triple aarch64-none-linux-gnu -target-feature +sve -pedantic -verify -Wsign-compare -Wtype-limits -fsyntax-only /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c -fenable-matrix -DTEST=3
# executed command: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/lib/clang/include -nostdsysteminc -triple aarch64-none-linux-gnu -target-feature +sve -pedantic -verify -Wsign-compare -Wtype-limits -fsyntax-only /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c -fenable-matrix -DTEST=3
# .---command stderr------------
# | error: 'expected-error' diagnostics expected but not seen: 
# |   File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c Line 537 (directive at /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c:538): cannot convert between scalar type 'int' and vector type 'svuint8_t' (aka '__SVUint8_t') as implicit conversion would cause truncation
# |   File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c Line 539 (directive at /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c:540): cannot convert between scalar type 'int' and vector type 'svuint8_t' (aka '__SVUint8_t') as implicit conversion would cause truncation
# | error: 'expected-error' diagnostics seen but not expected: 
# |   File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c Line 533: 'arm_sve.h' file not found
# | error: 'expected-warning' diagnostics expected but not seen: 
# |   File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c Line 547: comparison of integers of different signs: 'int' and 'gh203575_uvec' (vector of 1 'unsigned int' value)
# |   File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c Line 551: comparison of integers of different signs: 'int' and 'gh203575_uvec' (vector of 1 'unsigned int' value)
# |   File /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/Sema/compare.c Line 555: comparison of integers of different signs: 'int' and 'gh203575_uvec' (vector of 1 'unsigned int' value)
# | 6 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

--

********************


```

</details>

https://github.com/llvm/llvm-project/pull/182627


More information about the cfe-commits mailing list