http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57537
Bug ID: 57537
Summary: [4.8/4.9] gcc.dg/vect/slp-widen-mult-half.c generating
wrong code on PowerPC64
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: brooks at gcc dot gnu.org
The gcc.dg/vect/slp-widen-mult-half.c test tests autovectorization of this
inner loop:
for (i = 0; i < N/2; i++)
{
out[2*i] = in[2*i] * COEF;
out2[2*i] = in[2*i] + COEF2;
out[2*i+1] = in[2*i+1] * COEF;
out2[2*i+1] = in[2*i+1] + COEF2;
}
The execution portion of this test is failing on AltiVec-enabled powerpc64
targets on both the 4.8 branch (which is essentially at the point of the 4.8.1
release at the point I tested it) and on trunk.
The symptoms appear to strongly indicate that this is a simple matter of wrong
code generation: the out[] array is zeroed out rather than having the correct
values assigned. The out2[] array is correct.
In case it helps someone, here is the line of instrumentation code that I added
to the test to investigate the computed values:
for (i = 0; i < N; i++)
printf("at %d: %d == %d, %d == %d\n", i, out[i], in[i] * COEF,
out2[i], in[i] + COEF2);
I also tried putting some nonzero initial values in out[] before the vectorized
loop; the output remains zero, so this is being actively zeroed out.