aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-10-19 12:53:35 -0700
committerH.J. Lu <hjl.tools@gmail.com>2022-11-08 13:07:13 -0800
commit0138ebcd482c71f55d74eb9fa533fbb54a4391d6 (patch)
tree59833ecf3881704ebdc1b002e468e0129821e1d5 /gcc/testsuite/gcc.target
parent04f1b7658d75eec16a5d43320a9bbd75099cca17 (diff)
downloadgcc-0138ebcd482c71f55d74eb9fa533fbb54a4391d6.zip
gcc-0138ebcd482c71f55d74eb9fa533fbb54a4391d6.tar.gz
gcc-0138ebcd482c71f55d74eb9fa533fbb54a4391d6.tar.bz2
Always use TYPE_MODE instead of DECL_MODE for vector field
e034c5c8957 re PR target/78643 (ICE in convert_move, at expr.c:230) fixed the case where DECL_MODE of a vector field is BLKmode and its TYPE_MODE is a vector mode because of target attribute. Remove the BLKmode check for the case where DECL_MODE of a vector field is a vector mode and its TYPE_MODE isn't a vector mode because of target attribute. gcc/ PR target/107304 * expr.cc (get_inner_reference): Always use TYPE_MODE for vector field with vector raw mode. gcc/testsuite/ PR target/107304 * gcc.target/i386/pr107304.c: New test. (cherry picked from commit 1c64aba8cdf6509533f554ad86640f274cdbe37f)
Diffstat (limited to 'gcc/testsuite/gcc.target')
-rw-r--r--gcc/testsuite/gcc.target/i386/pr107304.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr107304.c b/gcc/testsuite/gcc.target/i386/pr107304.c
new file mode 100644
index 0000000..24d6879
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr107304.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O0 -march=tigerlake" } */
+
+#include <stdint.h>
+
+typedef union {
+ uint8_t v __attribute__((aligned(256))) __attribute__ ((vector_size(64 * sizeof(uint8_t))));
+ uint8_t i[64] __attribute__((aligned(256)));
+} stress_vec_u8_64_t;
+
+typedef struct {
+ struct {
+ stress_vec_u8_64_t s;
+ stress_vec_u8_64_t o;
+ stress_vec_u8_64_t mask1;
+ stress_vec_u8_64_t mask2;
+ } u8_64;
+} stress_vec_data_t;
+
+__attribute__((target_clones("arch=alderlake", "default")))
+void
+stress_vecshuf_u8_64(stress_vec_data_t *data)
+{
+ stress_vec_u8_64_t *__restrict s;
+ stress_vec_u8_64_t *__restrict mask1;
+ stress_vec_u8_64_t *__restrict mask2;
+ register int i;
+
+ s = &data->u8_64.s;
+ mask1 = &data->u8_64.mask1;
+ mask2 = &data->u8_64.mask2;
+
+ for (i = 0; i < 256; i++) { /* was i < 65536 */
+ stress_vec_u8_64_t tmp;
+
+ tmp.v = __builtin_shuffle(s->v, mask1->v);
+ s->v = __builtin_shuffle(tmp.v, mask2->v);
+ }
+}