Hi all,

This patch fixes PR99102. For masked gather loads/scatter stores the
'loop_masks' variable was checked to be non-null, but the 'final_mask' was the
actual mask used.

bootstrapped and regression tested on aarch64. Regression tested on aarch64_sve
under qemu.

 [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.target/aarch64/sve/pr99102.c: New test.

Attachment: diff
Description: diff

Reply via email to