[llvm-branch-commits] [clang] 91f2360 - Revert "[Clang] Fix assertion "unsigned range includes negative?" in AnalyzeC…"
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Sep 22 06:02:12 PDT 2026
Author: Aaron Ballman
Date: 2026-09-22T09:02:04-04:00
New Revision: 91f23604545c408ae18ff533d6e1ef9e9e85c453
URL: https://github.com/llvm/llvm-project/commit/91f23604545c408ae18ff533d6e1ef9e9e85c453
DIFF: https://github.com/llvm/llvm-project/commit/91f23604545c408ae18ff533d6e1ef9e9e85c453.diff
LOG: Revert "[Clang] Fix assertion "unsigned range includes negative?" in AnalyzeC…"
This reverts commit cec2eeb8ff2f1075b036d9bfd06c365d006bc972.
Added:
Modified:
clang/docs/ReleaseNotes.md
clang/test/Sema/compare.c
Removed:
################################################################################
diff --git a/clang/docs/ReleaseNotes.md b/clang/docs/ReleaseNotes.md
index da561d8b57204..ba944a62a1fff 100644
--- a/clang/docs/ReleaseNotes.md
+++ b/clang/docs/ReleaseNotes.md
@@ -284,11 +284,6 @@ features cannot lower the translation-unit ABI level;
### Improvements to Clang's diagnostics
-- Clang now doesn't throw assertion errors when comparing unsigned vector types
- (#GH173614).
-
-- `-Wfortify-source` now diagnoses when `strlcat` or `__builtin_strlcat` is called with a size
- argument larger than the destination buffer.
- `-Wfortify-source` now diagnoses when `strlcat`, `__builtin_strlcat`, `strlcpy`, or
`__builtin_strlcpy` is called with a size argument larger than the destination buffer.
diff --git a/clang/test/Sema/compare.c b/clang/test/Sema/compare.c
index 54cc3ffcaf5dc..d01c33d61dc8c 100644
--- a/clang/test/Sema/compare.c
+++ b/clang/test/Sema/compare.c
@@ -1,6 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -Wtautological-constant-in-range-compare %s -Wno-unreachable-code -fenable-matrix -DTEST=1
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -Wtype-limits %s -Wno-unreachable-code -fenable-matrix -DTEST=2
-// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -pedantic -verify -Wsign-compare -Wtype-limits -fsyntax-only %s -fenable-matrix -DTEST=3
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -Wtautological-constant-in-range-compare %s -Wno-unreachable-code -DTEST=1
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -Wtype-limits %s -Wno-unreachable-code -DTEST=2
int test(char *C) { // nothing here should warn.
return C != ((void*)0);
@@ -483,63 +482,6 @@ int test26(short n) {
}
#endif
-typedef unsigned long __attribute__((__vector_size__(8))) V;
-
-void test27(void) {
- int i;
- V v;
-
- V v1 = i == (-v);
- // expected-warning at -1 {{comparison of integers of
diff erent signs: 'int' and 'V'}}
-
- V v2 = i == (+v);
- // expected-warning at -1 {{comparison of integers of
diff erent signs: 'int' and 'V'}}
-
- V v3 = i == (~v);
- // expected-warning at -1 {{comparison of integers of
diff erent signs: 'int' and 'V'}}
-
- V v4 = i == (!v);
- // expected-error at -1 {{invalid argument type 'V' (vector of 1 'unsigned long' value) to unary expression}}
-
- V v5 = i == (++v);
- // expected-error at -1 {{cannot increment value of type 'V'}}
-
- V v6 = i == (v++);
- // expected-error at -1 {{cannot increment value of type 'V'}}
-
- V v7 = i == (--v);
- // expected-error at -1 {{cannot decrement value of type 'V'}}
-
- V v8 = i == (v--);
- // expected-error at -1 {{cannot decrement value of type 'V'}}
-
- V v9 = i == (*v);
- // expected-error at -1 {{indirection requires pointer operand ('V' (vector of 1 'unsigned long' value) invalid)}}
-}
-
-typedef unsigned long __attribute__((matrix_type(8, 8))) M;
-
-void test28(void) {
- int i;
- M m;
-
- M m1 = i == (-m);
- // expected-error at -1 {{invalid argument type 'M' (aka 'unsigned long __attribute__((matrix_type(8, 8)))') to unary expression}}
- M m2 = i == (~m);
- // expected-error at -1 {{invalid argument type 'M' (aka 'unsigned long __attribute__((matrix_type(8, 8)))') to unary expression}}
-}
-
-#if TEST == 3
-#include <arm_sve.h>
-void test29(void) {
- int i;
- svuint8_t v = svdup_u8(5);
- svuint8_t v1 = i == (-v);
- // expected-error at -1 {{cannot convert between scalar type 'int' and vector type 'svuint8_t' (aka '__SVUint8_t') as implicit conversion would cause truncation}}
- svuint8_t v2 = i == (~v);
- // expected-error at -1 {{cannot convert between scalar type 'int' and vector type 'svuint8_t' (aka '__SVUint8_t') as implicit conversion would cause truncation}}
-}
-#endif
// GH203575
typedef unsigned gh203575_uvec __attribute__((__vector_size__(sizeof(int))));
More information about the llvm-branch-commits
mailing list