From: Andre Vieira Date: Fri, 19 Feb 2021 09:13:02 +0000 (+0000) Subject: aarch64: Check predicate when using gen_vec_duplicate [PR98657] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6070e39cd0af6ac4a88004c8b1b6a900a8bbce36;p=gcc.git aarch64: Check predicate when using gen_vec_duplicate [PR98657] Prevents generation of a vec_duplicate with illegal predicate in 3. gcc/ChangeLog: 2021-02-19 Andre Vieira PR target/98657 * config/aarch64/aarch64-sve.md (3): Use expand_vector_broadcast' to emit the vec_duplicate operand. gcc/testsuite/ChangeLog: 2021-02-19 Andre Vieira PR target/98657 * gcc.target/aarch64/sve/pr98657.c: New test. --- diff --git a/gcc/config/aarch64/aarch64-sve.md b/gcc/config/aarch64/aarch64-sve.md index 60831960031..7db2938bb84 100644 --- a/gcc/config/aarch64/aarch64-sve.md +++ b/gcc/config/aarch64/aarch64-sve.md @@ -4549,10 +4549,8 @@ } else { - amount = gen_reg_rtx (mode); - emit_insn (gen_vec_duplicate (amount, - convert_to_mode (mode, - operands[2], 0))); + amount = convert_to_mode (mode, operands[2], 0); + amount = expand_vector_broadcast (mode, amount); } emit_insn (gen_v3 (operands[0], operands[1], amount)); DONE; diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr98657.c b/gcc/testsuite/gcc.target/aarch64/sve/pr98657.c new file mode 100644 index 00000000000..592af25d7bb --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/pr98657.c @@ -0,0 +1,9 @@ +/* PR target/98657 */ +/* { dg-do compile } */ +/* { dg-options "-O3 -msve-vector-bits=256" } */ +extern char a[]; +void b(_Bool c[][18]) { + int d; + for (int e = 0; e < 23; e++) + a[e] = 6 >> c[1][d]; +}