This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/11832] Optimization of common code in switch statements
- From: "aldot at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jan 2008 09:19:55 -0000
- Subject: [Bug rtl-optimization/11832] Optimization of common code in switch statements
- References: <bug-11832-5666@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from aldot at gcc dot gnu dot org 2008-01-03 09:19 -------
Dummy sample that has a hoisting opportunity:
int bazoo (unsigned int in)
{
int i = 0;
if (in >= 0)
++i; /* hoist */
if (in >= 1)
++i;
if (in >= 2)
++i;
if (in >= 3)
++i;
if (in >= 4)
++i;
return i;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11832