[Bug target/29967] wrong code generated with -O2 on sh4-linux
--- Comment #3 from pinskia at gmail dot com 2006-11-24 06:32 --- Subject: Re: wrong code generated with -O2 on sh4-linux On Fri, 2006-11-24 at 06:20 +, sugioka at itonet dot co dot jp wrote: > > --- Comment #2 from sugioka at itonet dot co dot jp 2006-11-24 06:20 > --- > This code is reduced from gcc/java/expr.c(add_type_assertion). > jc1 is really miscompiled on sh4-linux, so bootstrapping > libgcj fails with segmentation fault in jc1. > > Should gcc/java/expr.c be fixed ? Yes it should. A warning is hard here unless we change the warning to be based on the flow. Thanks, Andrew Pinski -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29967
Re: [Bug target/29967] wrong code generated with -O2 on sh4-linux
On Fri, 2006-11-24 at 06:20 +, sugioka at itonet dot co dot jp wrote: > > --- Comment #2 from sugioka at itonet dot co dot jp 2006-11-24 06:20 > --- > This code is reduced from gcc/java/expr.c(add_type_assertion). > jc1 is really miscompiled on sh4-linux, so bootstrapping > libgcj fails with segmentation fault in jc1. > > Should gcc/java/expr.c be fixed ? Yes it should. A warning is hard here unless we change the warning to be based on the flow. Thanks, Andrew Pinski
[Bug target/29967] wrong code generated with -O2 on sh4-linux
--- Comment #2 from sugioka at itonet dot co dot jp 2006-11-24 06:20 --- This code is reduced from gcc/java/expr.c(add_type_assertion). jc1 is really miscompiled on sh4-linux, so bootstrapping libgcj fails with segmentation fault in jc1. Should gcc/java/expr.c be fixed ? It would be better if I got warning about aliasing rule violation. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29967
[Bug target/29967] wrong code generated with -O2 on sh4-linux
--- Comment #1 from pinskia at gcc dot gnu dot org 2006-11-24 06:00 --- *pp = malloc (sizeof (int)); **(int **)pp = code; /* segmentation fault here */ You are violating aliasing rules in that "void*" does not alias "int*" so the optimizers are swapping around the store to *pp and the load of *(int**)(pp). -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29967