[gcc r16-7267] Split gcc.dg/pr123109.c into scalar and vector parts
Pengxuan Zheng
pzheng@gcc.gnu.org
Tue Feb 3 18:56:54 GMT 2026
https://gcc.gnu.org/g:98bcadc96c0782c33d98a1241062c12b7ad22f61
commit r16-7267-g98bcadc96c0782c33d98a1241062c12b7ad22f61
Author: Pengxuan Zheng <pengxuan.zheng@oss.qualcomm.com>
Date: Thu Jan 15 13:42:25 2026 -0800
Split gcc.dg/pr123109.c into scalar and vector parts
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>
Diff:
---
.../gcc.dg/{pr123109.c => pr123109-scalar.c} | 12 ++----------
gcc/testsuite/gcc.dg/pr123109-vector.c | 21 +++++++++++++++++++++
2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/gcc/testsuite/gcc.dg/pr123109.c b/gcc/testsuite/gcc.dg/pr123109-scalar.c
similarity index 54%
rename from gcc/testsuite/gcc.dg/pr123109.c
rename to gcc/testsuite/gcc.dg/pr123109-scalar.c
index 0d51863ca409..dda903a2ceef 100644
--- a/gcc/testsuite/gcc.dg/pr123109.c
+++ b/gcc/testsuite/gcc.dg/pr123109-scalar.c
@@ -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
index 000000000000..35a0f2eff62c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr123109-vector.c
@@ -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-*-* } } } } */
More information about the Gcc-cvs
mailing list