Fix permute handling when vectorising scatters
commitc8040004902f7824715ae7017b614ec623f93883
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Jan 2018 14:30:27 +0000 (9 14:30 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Jan 2018 14:30:27 +0000 (9 14:30 +0000)
treef961b0ea1d30ee5ba25759c42016f2ef9c9ed9dd
parentfdcf2b70e0c8c1a41616fa719cdad27b93cd0441
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256383 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/tree-vect-stmts.c