https://gcc.gnu.org/g:7a1d4d74e4505c7f44aa8fc90ac9bfc64179309c

commit r17-3827-g7a1d4d74e4505c7f44aa8fc90ac9bfc64179309c
Author: Georg-Johann Lay <[email protected]>
Date:   Tue Sep 1 19:10:01 2026 +0200

    Fix sloppy PR123109 tests
    
    gcc.dg/pr123109-vector.c failed with
    
    FAIL: gcc.dg/pr123109-vector.c (test for excess errors)
    Excess errors:
    gcc.dg/pr123109-vector.c:9:44: warning: right shift count >= width of 
vector element [-Wshift-count-overflow]
    gcc.dg/pr123109-vector.c:9:44: warning: right shift count >= width of 
vector element [-Wshift-count-overflow]
    gcc.dg/pr123109-vector.c:12:44: warning: right shift count >= width of 
vector element [-Wshift-count-overflow]
    gcc.dg/pr123109-vector.c:12:44: warning: right shift count >= width of 
vector element [-Wshift-count-overflow]
    
    gcc.dg/pr123109-vector.c: pattern found 0 times
    FAIL: gcc.dg/pr123109-vector.c scan-tree-dump-times forwprop2 ">= { 0, 0, 
0, 0 }" 2
    
    in the obvious expectation that the vectors have 4 SImode elements.
    Hence use __[U]INT32_TYPE__ for the elements instead of [unsigned] int.
    
    Similarly, gcc.dg/pr123109-scalar.c failed with:
    
    FAIL: gcc.dg/pr123109-scalar.c (test for excess errors)
    Excess errors:
    gcc.dg/pr123109-scalar.c:5:44: warning: right shift count >= width of type 
[-Wshift-count-overflow]
    gcc.dg/pr123109-scalar.c:5:44: warning: right shift count >= width of type 
[-Wshift-count-overflow]
    gcc.dg/pr123109-scalar.c:8:44: warning: right shift count >= width of type 
[-Wshift-count-overflow]
    gcc.dg/pr123109-scalar.c:8:44: warning: right shift count >= width of type 
[-Wshift-count-overflow]
    
    gcc.dg/pr123109-scalar.c: pattern found 0 times
    FAIL: gcc.dg/pr123109-scalar.c scan-tree-dump-times optimized ">= 0" 2
    gcc.dg/pr123109-scalar.c: pattern found 0 times
    FAIL: gcc.dg/pr123109-scalar.c scan-tree-dump-times optimized "< 0" 2
    
    with a similar bogus assumption that int is int32plus.
    
    gcc/testsuite/
            PR testsuite/123109
            * gcc.dg/pr123109-vector.c (v4si, v4usi): Use SImode elements.
            * gcc.dg/pr123109-scalar.c: Use 32-bit integer types.

Diff:
---
 gcc/testsuite/gcc.dg/pr123109-scalar.c | 8 ++++----
 gcc/testsuite/gcc.dg/pr123109-vector.c | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/pr123109-scalar.c 
b/gcc/testsuite/gcc.dg/pr123109-scalar.c
index dda903a2ceef..138cbd7ca0b0 100644
--- a/gcc/testsuite/gcc.dg/pr123109-scalar.c
+++ b/gcc/testsuite/gcc.dg/pr123109-scalar.c
@@ -7,10 +7,10 @@
 #define TEST_EQ(type)                                         \
   type test_eq_##type (type a) { return (a >> 31) == 0; }
 
-TEST_NE(int)
-TEST_NE(unsigned)
-TEST_EQ(int)
-TEST_EQ(unsigned)
+TEST_NE(__INT32_TYPE__)
+TEST_NE(__UINT32_TYPE__)
+TEST_EQ(__INT32_TYPE__)
+TEST_EQ(__UINT32_TYPE__)
 
 /* { dg-final { scan-tree-dump-times ">= 0" 2 optimized } } */
 /* { dg-final { scan-tree-dump-times "< 0" 2 optimized } } */
diff --git a/gcc/testsuite/gcc.dg/pr123109-vector.c 
b/gcc/testsuite/gcc.dg/pr123109-vector.c
index 35a0f2eff62c..19e944fe30bf 100644
--- a/gcc/testsuite/gcc.dg/pr123109-vector.c
+++ b/gcc/testsuite/gcc.dg/pr123109-vector.c
@@ -2,8 +2,8 @@
 /* { dg-options "-Wno-psabi -O2 -fdump-tree-forwprop2" } */
 /* { dg-additional-options "-msse2" { target { i?86-*-* x86_64-*-* } } } */
 
-typedef int v4si __attribute__((vector_size(4 * sizeof(int))));
-typedef unsigned int v4usi __attribute__((vector_size(4 * sizeof(unsigned 
int))));
+typedef __INT32_TYPE__ v4si __attribute__((vector_size(4 * 
sizeof(__INT32_TYPE__))));
+typedef __UINT32_TYPE__ v4usi __attribute__((vector_size(4 * 
sizeof(__INT32_TYPE__))));
 
 #define TEST_NE(type)                                         \
   type test_ne_##type (type a) { return (a >> 31) != 0; }

Reply via email to