[Vect] Fix mask check on Scatter loads/stores
authorJoel Hutton <joel.hutton@arm.com>
Wed, 10 Mar 2021 12:22:45 +0000 (12:22 +0000)
committerJoel Hutton <joel.hutton@arm.com>
Wed, 10 Mar 2021 12:26:21 +0000 (12:26 +0000)
commit99d5299376d203fe5172574c2d6b0b088e532383
treef08b76b970cd86cf937498393ca75bab18ecac7e
parent6ceb712e2699a493da544b1755f6f73d62930f9b
[Vect] Fix mask check on Scatter loads/stores

Previously, IFN_MASK_SCATTER_STORE was used if 'loop_masks' was
non-null, but the mask used is 'final_mask'. This caused a bug where
a 'MASK_STORE' was vectorized into a 'SCATTER_STORE' instead of a
'MASK_SCATTER_STORE'. This fixes PR target/99102.

gcc/ChangeLog:

PR target/99102
* tree-vect-stmts.c (vectorizable_store): Fix scatter store mask
check condition.
(vectorizable_load): Fix gather load mask check condition.

gcc/testsuite/ChangeLog:

PR target/99102
* gcc.dg/vect/pr99102.c: New test.
gcc/testsuite/gcc.dg/vect/pr99102.c [new file with mode: 0644]
gcc/tree-vect-stmts.c