New tests for PR rtl-optimization/96298.
authorRoger Sayle <roger@nextmovesoftware.com>
Tue, 18 Aug 2020 13:45:52 +0000 (14:45 +0100)
committerRoger Sayle <roger@nextmovesoftware.com>
Tue, 18 Aug 2020 13:45:52 +0000 (14:45 +0100)
Tests to confirm PR rtl-optimization is now fixed, remains so.

2020-08-18  Roger Sayle  <roger@nextmovesoftware.com>
    Zdenek Sojka  <zsojka@seznam.cz>

gcc/testsuite/ChangeLog
PR rtl-optimization/96298
* gcc.dg/pr96298.c: New test.
* gcc.target/i386/pr96298.c: New test.

gcc/testsuite/gcc.dg/pr96298.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr96298.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/pr96298.c b/gcc/testsuite/gcc.dg/pr96298.c
new file mode 100644 (file)
index 0000000..8f82575
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR rtl-optimization/96298 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-forwprop" } */
+
+typedef unsigned char __attribute__ ((__vector_size__ (8))) v64u8;
+
+v64u8 a;
+
+int
+main (void)
+{
+  v64u8 x = (a - 1) ^ -a;
+  for (unsigned i = 0; i < sizeof (x); i++)
+    if (x[i] != 0xff)
+      __builtin_abort ();
+  return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/pr96298.c b/gcc/testsuite/gcc.target/i386/pr96298.c
new file mode 100644 (file)
index 0000000..d304ddd
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR rtl-optimization/96298 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-forwprop -mno-sse" } */
+
+typedef unsigned char __attribute__ ((__vector_size__ (8))) v64u8;
+
+v64u8 a;
+
+int
+main (void)
+{
+  v64u8 x = (a - 1) ^ -a;
+  for (unsigned i = 0; i < sizeof (x); i++)
+    if (x[i] != 0xff)
+      __builtin_abort ();
+  return 0;
+}
+