https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110541
Bug ID: 110541
Summary: Invalid VEC_PERM_EXPR mask element size
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: kristerw at gcc dot gnu.org
Target Milestone: ---
tree.def says:
The number of MASK elements must be the same with the
number of elements in V0 and V1. The size of the inner type
of the MASK and of the V0 and V1 must be the same.
But tree-vectorizer creates permutations where the MASK element size is
different than for V0 and V1, such as
vector(8) unsigned short _79;
...
_79 = VEC_PERM_EXPR <_78, { 0, 0, 0, 0, 0, 0, 0, 0 }, { 4, 5, 6, 7, 8, 9, 10,
11 }>;
where the MASK elements are of a 64-bit type.
This can be seen when compiling the following function (from
gcc.c-torture/compile/20000717-1.c) as "gcc -S -O3" for x86_64:
short
inner_product (short *a, short *b)
{
int i;
short sum = 0;
for (i = 9; i >= 0; i--)
sum += (*a++) * (*b++);
return sum;
}