I'm having trouble understanding a warning from IBM XL C/C++. I'm working on GCC119 from the compile farm, which is a AIX ppc64-be machine.
$ cat test.cxx
#if defined(__ALTIVEC__)
# include <altivec.h>
# undef vector
# undef pixel
# undef bool
#endif
__vector unsigned char VecLoad(unsigned char data[])
{
return vec_ld(0, data);
}
Compiling it results in:
$ xlC -qarch=pwr5 -qaltivec test.cxx -c
1540-2142 (W) "-qaltivec" is not compatible with "-qarch=pwr5". "-qnoaltivec" is being set.
"test.cxx", line 8.10: 1540-0040 (S) The text "unsigned" is unexpected. "__vector" may be undeclared or ambiguous.
Removing the -qarch
does not resolve the issue as the compiler defaults to -qarch=pwr4
.
I only see this problem on the AIX machine using the XLC compiler. GCC is OK on the same machine. And two other machines I use for testing are OK. In fact the AIX machine is an S822, and an identical S822 running Linux with XLC installed is OK.
What is the problem and how do I fix it? Why can't we engage Altivec with POWER5 on AIX with XLC?