spu-gcc -O2 behaving wrong on PS3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cell-gcc (Ubuntu) |
Fix Released
|
Undecided
|
Dan Munckton |
Bug Description
Binary package hint: spu-gcc
Following program behaves incorrectly when compiled with -O1 or -O2 (-O0 and -O3 shows correct behaviour).
----
#include <stdio.h>
#include <stdlib.h>
struct mystruct_t {
int dimension;
};
struct mystruct_t *s;
void foo (void)
{
printf("dimension = %d (should be 1)\n", s->dimension);
}
int main (void)
{
s = malloc(
s->dimension = 1;
foo();
return 0;
}
----
dotslash@
nd = 1 (should be 1)
dotslash@
nd = 0 (should be 1)
dotslash@
nd = 0 (should be 1)
dotslash@
nd = 1 (should be 1)
system information:
Playstation 3
dotslash@
Description: Ubuntu 7.10
Release: 7.10
dotslash@
/usr/bin/spu-gcc
dotslash@
spu-gcc:
Installed: 4.1.1r840-0ubuntu7
Candidate: 4.1.1r840-0ubuntu7
Version table:
*** 4.1.1r840-0ubuntu7 0
500 http://
100 /var/lib/
Could you try using the updated cell-gcc packages from our PPA here ...
https:/ /launchpad. net/~ubuntu- ps3-dev/ +archive
... and see if that makes the problem go away?
You may have to build the debs yourself to get these to install on 7.10 as they're built for hardy and intrepid only I'm afraid.