[Bug optimization/15221] New: a jump threading opportunity blocked by a few intervening instructions
kazu at cs dot umass dot edu
gcc-bugzilla@gcc.gnu.org
Fri Apr 30 11:05:00 GMT 2004
We could turn foo into bar. That is, if only a few insturctions are blocking
jump threading opportunity, we should put those blocking instructions to both
branches and perform jump threading.
In certain cases, including this one, we have a size win also.
int f0 (void);
int f1 (void);
int g0 (int);
int g1 (int);
int
foo (int a, int c)
{
int tem;
if (a)
tem = f0 ();
else
tem = g0 (tem);
tem += c;
if (a)
tem = f0 ();
else
tem = g1 (tem);
tem + 1;
}
int
bar (int a, int c)
{
int tem;
if (a)
{
tem = f0 ();
tem += c;
tem = g0 (tem);
}
else
{
tem = f1 ();
tem += c;
tem = g1 (tem);
}
return tem + 1;
}
--
Summary: a jump threading opportunity blocked by a few
intervening instructions
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Keywords: pessimizes-code
Severity: enhancement
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kazu at cs dot umass dot edu
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15221
More information about the Gcc-bugs
mailing list