This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/29967] New: wrong code generated with -O2 on sh4-linux
- From: "sugioka at itonet dot co dot jp" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Nov 2006 05:48:24 -0000
- Subject: [Bug target/29967] New: wrong code generated with -O2 on sh4-linux
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
gcc 4.1.1 generates wrong code for following source with -O2
on sh4-linux.
'-fno-schedule-insns' fixes this problem.
int *p = 0;
void *bar()
{
return (void *)&p;
}
void foo (int code)
{
void **pp;
pp = bar();
*pp = malloc (sizeof (int));
**(int **)pp = code; /* segmentation fault here */
}
int main()
{
foo(1);
}
--
Summary: wrong code generated with -O2 on sh4-linux
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sugioka at itonet dot co dot jp
GCC build triplet: sh4-unknown-linux
GCC host triplet: sh4-unknown-linux
GCC target triplet: sh4-unknown-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29967