[TESTCASE] gcc miscompiles Altivec code
Aldy Hernandez
aldyh@redhat.com
Mon Feb 25 17:55:00 GMT 2002
On Tuesday, February 26, 2002, at 09:15 AM, Daniel Egger wrote:
> Hija,
>
> I distilled a (not so) small example for code being miscompiled
> by gcc from yesterday on linux-ppc.
> This one will segfault on my maschine when compiled with -O0.
this is really helpful. thanks.
however...
tried it on my darwin box... compiles fine with -O[012]. i tried
it on apple's altivec compiler and the resulting vectors are all zero.
i added a loop like this to print them:
for (i=0; i < 7; ++i) {
printv((vector signed int)vec[i]);
printv((vector signed int)v1[i]);
printv((vector signed int)v2[i]);
}
typedef vector signed int vecint;
void printv(vecint v)
{
int foo[4] __attribute__((aligned(16))) ;
vec_st (v, 0, foo);
printf("%x %x %x %x a3\n", foo[0], foo[1], foo[2], foo[3]);
}
i ran with cvs gcc, and it not only compiles but yields the same 0's
as the apple compiler.
are you passing any special flags to cc1?
More information about the Gcc
mailing list