diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2022-05-10 09:33:16 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2022-05-10 09:36:14 +0200 |
commit | 60ab3d0f2d9f95045543fea361e976351e76b5a1 (patch) | |
tree | 65b0178951a6a81152864e4691efe08c13ab4bf5 /gcc/testsuite | |
parent | 28896b38fabce818e59266b0063a46b3bc1b700f (diff) | |
download | gcc-60ab3d0f2d9f95045543fea361e976351e76b5a1.zip gcc-60ab3d0f2d9f95045543fea361e976351e76b5a1.tar.gz gcc-60ab3d0f2d9f95045543fea361e976351e76b5a1.tar.bz2 |
Fix internal error with vectorization on SPARC
This is a regression present since the 10.x series, but the underlying issue
has been there since the TARGET_VEC_PERM_CONST hook was implemented, in the
form of an ICE when expanding a constant VEC_PERM_EXPR in V4QI, while the
back-end only supports V8QI constant VEC_PERM_EXPRs.
gcc/
PR target/105292
* config/sparc/sparc.cc (sparc_vectorize_vec_perm_const): Return
true only for 8-byte vector modes.
gcc/testsuite/
* gcc.target/sparc/20220510-1.c: New test.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/20220510-1.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/sparc/20220510-1.c b/gcc/testsuite/gcc.target/sparc/20220510-1.c new file mode 100644 index 0000000..f321cab --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/20220510-1.c @@ -0,0 +1,31 @@ +/* PR target/105292 */ +/* Reported by Koakuma <koachan+gccbugs@protonmail.com> */ + +/* { dg-do compile } */ +/* { dg-options "-O3 -mvis2" } */ + +extern void get_vbytes_v2 (unsigned); + +typedef struct { + unsigned ctt_info; + unsigned ctt_size; +} ctf_type_t; + +typedef struct { + unsigned short cts_offset; + unsigned short cts_bits; +} ctf_slice_t; + +void flip_types_len (ctf_type_t *t, int bsx1, int bsx2) +{ + const int kind = t->ctt_info; + + get_vbytes_v2 (t->ctt_size); + + if (kind == 4) + { + ctf_slice_t *s = (ctf_slice_t *)t; + s->cts_offset = __builtin_bswap16(bsx1); + s->cts_bits = __builtin_bswap16(bsx2); + } +} |