All of lore.kernel.org
 help / color / mirror / Atom feed
* GCC -O2 failure for mipsel
@ 2003-05-01  5:39 Fuxin Zhang
  2003-05-01  8:27 ` Andrew Haley
  0 siblings, 1 reply; 19+ messages in thread
From: Fuxin Zhang @ 2003-05-01  5:39 UTC (permalink / raw)
  To: MAKE FUN PRANK CALLS, gcc

Hello,
I've met a case where mipsel-linux-gcc -O2 fails,for both
2.96 and the fresh new 3.2.3. Maybe someone can tell me
what's wrong.

I've reduced the problem to the test case below,compile it
with mipsel-linux-gcc -O2(FROM H.J.Lu's redhat miniport,all version,
and 3.2.3 is tested too)


#define PUT_CODE(x,code) ((x)->code = (code))
union test_union {
struct test *t;
int a;
};

struct test {
unsigned short code;
union test_union u[1];
};

char memory[2000];

struct test *test_alloc(int code)
{
struct test *t;
int length=sizeof(struct test);

t = (struct test*)memory;
length = (sizeof(struct test) - sizeof(union test_union)-1)/sizeof(int);
for (;length>=0;length--)
((int*)t)[length] = 0;

PUT_CODE(t,code);

return t;
}

int main()
{
struct test *t;

t = test_alloc(4);

printf("t->code=%d\n",t->code);
}


Problem happens in test_alloc:

00400890 <test_alloc>:
400890: 3c1c0fc0 lui gp,0xfc0
400894: 279c77b0 addiu gp,gp,30640
400898: 0399e021 addu gp,gp,t9
40089c: 8f828054 lw v0,-32684(gp)
4008a0: 8f818054 lw at,-32684(gp)
4008a4: 00000000 nop
4008a8: a4240000 sh a0,0(at)
4008ac: 03e00008 jr ra
4008b0: ac400000 sw zero,0(v0)
--->the last sw is wrong,it should not be reorder to run later than 4008a8.

And gcc experts will find this is a simplfied case of rtx_alloc:).
Yes,the failure
shows up when i try to compile SPEC CPU2000 176.gcc with -O2. The const0_rtx
's code will be set to zero like above.

Thank you in advance.


Regards

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2003-05-09 17:14 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-01  5:39 GCC -O2 failure for mipsel Fuxin Zhang
2003-05-01  8:27 ` Andrew Haley
2003-05-01  8:41   ` Fuxin Zhang
2003-05-01  8:46     ` Andrew Haley
2003-05-01  8:50       ` Greg Lindahl
2003-05-09  2:05         ` Problem of cross-mipsel-compiler GLIBC-2.3.X smills_ho
2003-05-09  2:05           ` smills_ho
2003-05-09  7:21           ` Eric Christopher
2003-05-09  7:29             ` Kumba
2003-05-09  8:15               ` smills_ho
2003-05-09  8:15                 ` smills_ho
2003-05-09  8:30                 ` Kumba
2003-05-09  9:40                   ` smills_ho
2003-05-09  9:40                     ` smills_ho
2003-05-09 11:20                   ` Guido Guenther
2003-05-09  8:10             ` smills_ho
2003-05-09  8:10               ` smills_ho
2003-05-09 17:13               ` Eric Christopher
2003-05-01 11:00       ` GCC -O2 failure for mipsel Andrew Pinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.