]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Split gcc.dg/pr123109.c into scalar and vector parts
authorPengxuan Zheng <pengxuan.zheng@oss.qualcomm.com>
Thu, 15 Jan 2026 21:42:25 +0000 (13:42 -0800)
committerPengxuan Zheng <pengxuan.zheng@oss.qualcomm.com>
Tue, 3 Feb 2026 18:56:26 +0000 (10:56 -0800)
Split gcc.dg/pr123109.c into scalar and vector parts as suggested by Jakub.

gcc/testsuite/ChangeLog:

* gcc.dg/pr123109.c: Move to...
* gcc.dg/pr123109-vector.c: ...here.
* gcc.dg/pr123109-scalar.c: New test.

Signed-off-by: Pengxuan Zheng <pengxuan.zheng@oss.qualcomm.com>
gcc/testsuite/gcc.dg/pr123109-scalar.c [moved from gcc/testsuite/gcc.dg/pr123109.c with 54% similarity]
gcc/testsuite/gcc.dg/pr123109-vector.c [new file with mode: 0644]

similarity index 54%
rename from gcc/testsuite/gcc.dg/pr123109.c
rename to gcc/testsuite/gcc.dg/pr123109-scalar.c
index 0d51863ca40992b371bbf06ef87fb4e6f0569fab..dda903a2ceef95351b7de3b03f2e33c11beeca95 100644 (file)
@@ -1,9 +1,6 @@
-/* { dg-do compile { target { x86_64-*-* aarch64-*-* } } } */
+/* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-optimized" } */
 
-typedef int v4si __attribute__((vector_size(4 * sizeof(int))));
-typedef unsigned int v4usi __attribute__((vector_size(4 * sizeof(unsigned int))));
-
 #define TEST_NE(type)                                         \
   type test_ne_##type (type a) { return (a >> 31) != 0; }
 
@@ -12,14 +9,9 @@ typedef unsigned int v4usi __attribute__((vector_size(4 * sizeof(unsigned int)))
 
 TEST_NE(int)
 TEST_NE(unsigned)
-TEST_NE(v4si)
-TEST_NE(v4usi)
 TEST_EQ(int)
 TEST_EQ(unsigned)
-TEST_EQ(v4si)
-TEST_EQ(v4usi)
 
 /* { dg-final { scan-tree-dump-times ">= 0" 2 optimized } } */
 /* { dg-final { scan-tree-dump-times "< 0" 2 optimized } } */
-/* { dg-final { scan-tree-dump-times ">= { 0, 0, 0, 0 }" 2 optimized } } */
-/* { dg-final { scan-tree-dump-times ">> 31" 2 optimized } } */
+
diff --git a/gcc/testsuite/gcc.dg/pr123109-vector.c b/gcc/testsuite/gcc.dg/pr123109-vector.c
new file mode 100644 (file)
index 0000000..35a0f2e
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { 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))));
+
+#define TEST_NE(type)                                         \
+  type test_ne_##type (type a) { return (a >> 31) != 0; }
+
+#define TEST_EQ(type)                                         \
+  type test_eq_##type (type a) { return (a >> 31) == 0; }
+
+TEST_NE(v4si)
+TEST_NE(v4usi)
+TEST_EQ(v4si)
+TEST_EQ(v4usi)
+
+/* { dg-final { scan-tree-dump-times ">= { 0, 0, 0, 0 }" 2 forwprop2 } } */
+/* "a < 0 ? -1 : 0" will be optimized to "a >> 31" only if there's an optab.  */
+/* { dg-final { scan-tree-dump-times ">> 31" 2 forwprop2 { target { i?86-*-* x86_64-*-* aarch64-*-* } } } } */