[TESTCASE] gcc miscompiles Altivec code
Dale Johannesen
dalej@apple.com
Mon Feb 25 19:10:00 GMT 2002
On Monday, February 25, 2002, at 04:16 PM, Aldy Hernandez wrote:
>
> 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.
Works for me, on the installed 2.95 compiler and on the 3. under
development.
Which one are you talking about Aldy?
Note that the posted testcase prints out the value after only one transpose
...v1[7] = vec[7];
Transpose (v1, v2);
Transpose (v2, v1);
vec[0] = v2[0];... // v1 value lost
so the right answer is really
1 9 17 25 33 41 49 57
2 10 18 26 34 42 50 58
3 11 19 27 35 43 51 59
4 12 20 28 36 44 52 60
5 13 21 29 37 45 53 61
6 14 22 30 38 46 54 62
7 15 23 31 39 47 55 63
8 16 24 32 4 48 56 64
More information about the Gcc
mailing list