https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112406
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Robin Dapp <rd...@gcc.gnu.org>: https://gcc.gnu.org/g:231bb992592a9e1bd7ce6583131acb1874c8e34e commit r14-5564-g231bb992592a9e1bd7ce6583131acb1874c8e34e Author: Robin Dapp <rd...@ventanamicro.com> Date: Thu Nov 16 20:42:10 2023 +0100 vect: Pass truth type to vect_get_vec_defs. For conditional operations the mask is loop invariant and cannot be stored explicitly. By default, for reductions, we deduce the vectype from the statement or the loop but this does not work for conditional operations. Therefore this patch passes the truth type of the reduction input vectype for the mask operand instead. This will override the other choices and make sure we have the proper mask vectype. gcc/ChangeLog: PR middle-end/112406 PR middle-end/112552 * tree-vect-loop.cc (vect_transform_reduction): Pass truth vectype for mask operand. gcc/testsuite/ChangeLog: * gcc.target/aarch64/pr112406.c: New test. * gcc.target/riscv/rvv/autovec/pr112552.c: New test.