This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14706] New: [tree-ssa] range checks should be merged.
- 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: 24 Mar 2004 05:22:51 -0000
- Subject: [Bug optimization/14706] New: [tree-ssa] range checks should be merged.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
We know that fold() can fold (a > 10 && a < 20) into
((unsigned int) (a - 11) <= 8).
We should also be able to optimize foo() in a similar way.
Note that bar() can be implemented using a conditional move and no jump.
int g;
void
foo (int a)
{
if (a > 10)
if (a < 20)
g = 0;
}
void
bar (int a)
{
if ((unsigned int) (a - 11) <= 8)
g = 0;
}
--
Summary: [tree-ssa] range checks should be merged.
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=14706