https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71722
Bug ID: 71722
Summary: incorrect code for test pr64252.c for -mcpu=power9
-mpower9-vector -ftree-vectorize -O3
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: acsawdey at gcc dot gnu.org
CC: bergner at gcc dot gnu.org, wschmidt at gcc dot gnu.org
Target Milestone: ---
Target: powerpc64le-linux
Created attachment 38808
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38808&action=edit
preprocessed test case
It looks like the code for the last iteration is not working properly here:
#1 0x00000000100005f0 in main () at
/home/sawdey/src/gcc/trunk/gcc/gcc/testsuite/gcc.dg/vect/pr64252.c:62
62 abort ();
(gdb) l
57 int i;
58 check_vect ();
59 bar(2, q);
60 for (i = 0; i < N; i++)
61 if (q[0].a[i].f != 0 || q[0].a[i].c != i || q[0].a[i].p != -1)
62 abort ();
63 return 0;
64 }
(gdb) p N
$1 = 50
(gdb) p q[0]
$2 = {a = {{f = a, c = 0, p = 4294967295}, {f = a, c = 1, p = 4294967295}, {f =
a, c = 2, p = 4294967295}, {f = a, c = 3, p = 4294967295}, {f = a, c = 4, p =
4294967295}, {f = a, c = 5, p = 4294967295}, {
f = a, c = 6, p = 4294967295}, {f = a, c = 7, p = 4294967295}, {f = a, c
= 8, p = 4294967295}, {f = a, c = 9, p = 4294967295}, {f = a, c = 10, p =
4294967295}, {f = a, c = 11, p = 4294967295}, {f = a,
c = 12, p = 4294967295}, {f = a, c = 13, p = 4294967295}, {f = a, c = 14,
p = 4294967295}, {f = a, c = 15, p = 4294967295}, {f = a, c = 16, p =
4294967295}, {f = a, c = 17, p = 4294967295}, {f = a,
c = 18, p = 4294967295}, {f = a, c = 19, p = 4294967295}, {f = a, c = 20,
p = 4294967295}, {f = a, c = 21, p = 4294967295}, {f = a, c = 22, p =
4294967295}, {f = a, c = 23, p = 4294967295}, {f = a,
c = 24, p = 4294967295}, {f = a, c = 25, p = 4294967295}, {f = a, c = 26,
p = 4294967295}, {f = a, c = 27, p = 4294967295}, {f = a, c = 28, p =
4294967295}, {f = a, c = 29, p = 4294967295}, {f = a,
c = 30, p = 4294967295}, {f = a, c = 31, p = 4294967295}, {f = a, c = 32,
p = 4294967295}, {f = a, c = 33, p = 4294967295}, {f = a, c = 34, p =
4294967295}, {f = a, c = 35, p = 4294967295}, {f = a,
c = 36, p = 4294967295}, {f = a, c = 37, p = 4294967295}, {f = a, c = 38,
p = 4294967295}, {f = a, c = 39, p = 4294967295}, {f = a, c = 40, p =
4294967295}, {f = a, c = 41, p = 4294967295}, {f = a,
c = 42, p = 4294967295}, {f = a, c = 43, p = 4294967295}, {f = a, c = 44,
p = 4294967295}, {f = a, c = 45, p = 4294967295}, {f = a, c = 46, p = 47}, {f =
(b | c | unknown: 4294967292), c = 4294967295,
p = 0}, {f = a, c = 48, p = 4294967295}, {f = a, c = 49, p =
4294967295}}}
Tested with trunk 237715
compiler options: -mcpu=power9 -fno-diagnostics-show-caret
-fdiagnostics-color=never -maltivec -mpower9-vector -ftree-vectorize
-fno-vect-cost-model -fno-common -O2 -fdump-tree-vect-details -O3 -lm -ggdb -g3
This may be related to the test case gcc.dg/vect/pr45752.c which also fails and
produces similar looking code (at a glance) that does not involve xxspltw.