aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-09 14:30:27 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-09 14:30:27 +0000
commit7ad429a4de1197b4b032da0981a2c91ac5d0dd06 (patch)
treef961b0ea1d30ee5ba25759c42016f2ef9c9ed9dd /gcc
parent82c066f587fe99cc3d5cd0d685582f0272d3a40f (diff)
downloadgcc-7ad429a4de1197b4b032da0981a2c91ac5d0dd06.zip
gcc-7ad429a4de1197b4b032da0981a2c91ac5d0dd06.tar.gz
gcc-7ad429a4de1197b4b032da0981a2c91ac5d0dd06.tar.bz2
Fix permute handling when vectorising scatters
As mentioned in https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01575.html , the scatter handling in vectorizable_store seems to be dead code at the moment. Enabling it with the vect_analyze_data_ref_access part of that patch triggered an ICE in the avx512f-scatter-*.c tests (which previously didn't use scatters). The problem was that the NARROW and WIDEN handling uses permute_vec_elements to marshal the inputs, and permute_vec_elements expected the lhs of the stmt to be an SSA_NAME, which of course it isn't for stores. This patch makes permute_vec_elements create a fresh variable in this case. 2018-01-09 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * tree-vect-stmts.c (permute_vec_elements): Create a fresh variable if the destination isn't an SSA_NAME. From-SVN: r256383
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-vect-stmts.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f908b7c..d3c313d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * tree-vect-stmts.c (permute_vec_elements): Create a fresh variable
+ if the destination isn't an SSA_NAME.
+
2018-01-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/83668
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 16088b0..a4f2d71 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -6585,7 +6585,11 @@ permute_vec_elements (tree x, tree y, tree mask_vec, gimple *stmt,
tree perm_dest, data_ref;
gimple *perm_stmt;
- perm_dest = vect_create_destination_var (gimple_get_lhs (stmt), vectype);
+ tree scalar_dest = gimple_get_lhs (stmt);
+ if (TREE_CODE (scalar_dest) == SSA_NAME)
+ perm_dest = vect_create_destination_var (scalar_dest, vectype);
+ else
+ perm_dest = vect_get_new_vect_var (vectype, vect_simple_var, NULL);
data_ref = make_ssa_name (perm_dest);
/* Generate the permute statement. */