This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14799] New: [tree-ssa] convert a sequence of "if"s to a "switch" statement
- 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: 31 Mar 2004 11:24:50 -0000
- Subject: [Bug optimization/14799] New: [tree-ssa] convert a sequence of "if"s to a "switch" statement
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
void bar (void);
void
foo (int a)
{
if (a == 30)
bar ();
else if (a == 31)
bar ();
else if (a == 53)
bar ();
else if (a == 23)
bar ();
}
The idea comes from LLVM.
Of course we should do this only if switch statements are expanded in
an (almost?) optimal way.
--
Summary: [tree-ssa] convert a sequence of "if"s to a "switch"
statement
Product: gcc
Version: tree-ssa
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=14799