This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/20386] New: Missing computed goto to normal goto optimization
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Mar 2005 18:29:59 -0000
- Subject: [Bug tree-optimization/20386] New: Missing computed goto to normal goto optimization
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
We miss a computed goto to non computed got if there is code between the assignment and the goto:
void g();
int f(int i)
{
void *a;
if (i) a = &&l1;
else a = &&l2;
g();
goto *a;
l1:
return 1;
l2:
return 2;
}
I saw this while debugging PR13024.java and why if I tried compiling it with javac it passed.
That function should be equivalent to the following:
void g();
int f(int i)
{
void *a;
g();
if (i) a = &&l1;
else a = &&l2;
goto *a;
l1:
return 1;
l2:
return 2;
}
where we check i is not revalant here.
--
Summary: Missing computed goto to normal goto optimization
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20386