From d850dec9b7bd02ef925def138894402038cca78d Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Tue, 18 Aug 2020 14:45:52 +0100 Subject: [PATCH] New tests for PR rtl-optimization/96298. Tests to confirm PR rtl-optimization is now fixed, remains so. 2020-08-18 Roger Sayle Zdenek Sojka 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 | 18 ++++++++++++++++++ gcc/testsuite/gcc.target/i386/pr96298.c | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr96298.c create mode 100644 gcc/testsuite/gcc.target/i386/pr96298.c diff --git a/gcc/testsuite/gcc.dg/pr96298.c b/gcc/testsuite/gcc.dg/pr96298.c new file mode 100644 index 00000000000..8f825751ee4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr96298.c @@ -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 index 00000000000..d304ddd29cd --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr96298.c @@ -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; +} + -- 2.30.2