This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/14327] New: -O0 -fdefer-pop generates wrong code
- From: "jfran at clip dot dia dot fi dot upm dot es" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Feb 2004 23:59:19 -0000
- Subject: [Bug c/14327] New: -O0 -fdefer-pop generates wrong code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program is not compiled correctly
and produces a segmentation fault if compiled with
-O0 -fderef-pop. The code is compiled correctly
with -fno-defer-pop, or using a version =<3.2
//
int code[]={0,0,0,0,1};
void foo(int x) {
volatile int b;
b = 0xffffffff;
}
void bar(int *pc) {
static const void *l[] = {&&lab0, &&end};
foo(0);
goto *l[*pc];
lab0:
foo(0);
pc++;
goto *l[*pc];
end:
return;
}
int main() {
bar(code);
return 0;
}
--
Summary: -O0 -fdefer-pop generates wrong code
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: critical
Priority: P1
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jfran at clip dot dia dot fi dot upm dot es
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14327