Author: Aaron Ballman
Date: 2026-09-22T09:02:48-04:00
New Revision: c4045dbc18c6637ebc218fe1a82ee62288613c2c

URL: 
https://github.com/llvm/llvm-project/commit/c4045dbc18c6637ebc218fe1a82ee62288613c2c
DIFF: 
https://github.com/llvm/llvm-project/commit/c4045dbc18c6637ebc218fe1a82ee62288613c2c.diff

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

Reverts llvm/llvm-project#182627

Post-commit CI found issues:
https://lab.llvm.org/buildbot/#/builders/225/builds/19103

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@-1 {{comparison of integers of 
diff erent signs: 'int' and 'V'}}
-  
-  V v2 = i == (+v);
-  // expected-warning@-1 {{comparison of integers of 
diff erent signs: 'int' and 'V'}}
-  
-  V v3 = i == (~v);
-  // expected-warning@-1 {{comparison of integers of 
diff erent signs: 'int' and 'V'}}
-  
-  V v4 = i == (!v);
-  // expected-error@-1 {{invalid argument type 'V' (vector of 1 'unsigned 
long' value) to unary expression}}
-  
-  V v5 = i == (++v);
-  // expected-error@-1 {{cannot increment value of type 'V'}}
-  
-  V v6 = i == (v++);
-  // expected-error@-1 {{cannot increment value of type 'V'}}
-  
-  V v7 = i == (--v);
-  // expected-error@-1 {{cannot decrement value of type 'V'}}
-  
-  V v8 = i == (v--);
-  // expected-error@-1 {{cannot decrement value of type 'V'}}
-  
-  V v9 = i == (*v);
-  // expected-error@-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@-1 {{invalid argument type 'M' (aka 'unsigned long 
__attribute__((matrix_type(8, 8)))') to unary expression}}
-  M m2 = i == (~m);
-  // expected-error@-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@-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@-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))));
 


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to