This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/15221] New: a jump threading opportunity blocked by a few intervening instructions
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Apr 2004 09:24:47 -0000
- Subject: [Bug optimization/15221] New: a jump threading opportunity blocked by a few intervening instructions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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