https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121118
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Richard Sandiford <rsand...@gcc.gnu.org>: https://gcc.gnu.org/g:58a9717df098defb7f595fbc56122107e952a46b commit r15-10243-g58a9717df098defb7f595fbc56122107e952a46b Author: Richard Sandiford <richard.sandif...@arm.com> Date: Mon Aug 18 12:15:21 2025 +0100 aarch64: Fix mode mismatch when building a predicate [PR121118] This PR is about a case where we used aarch64_expand_sve_const_pred_trn to combine two predicates, one of which was constructing using aarch64_sve_move_pred_via_while. The former requires the inputs to have mode VNx16BI, but the latter returned VNx8BI for a .H WHILELO. The proper fix, used on trunk, is to make the pattern emitted by aarch64_sve_move_pred_via_while produce an VNx16BI for all element sizes, since every bit of the result is significant. However, that required some target-independent changes that are too invasive to backport. This patch goes for the simpler (but less robust) approach of using the original pattern and casting it to VNx16BI after the fact. Since the WHILELO pattern is an unspec, the chances of something optimising it in a way that changes the undefined bits of the output should be very low, especially on a release branch. It is still a less satisfactory fix though. gcc/ PR target/121118 * config/aarch64/aarch64.cc (aarch64_sve_move_pred_via_while): Return a VNx16BI predicate. gcc/testsuite/ PR target/121118 * gcc.target/aarch64/sve/acle/general/pr121118_1.c: New test.