This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14490] New: [tree-ssa] Simplify "a - 10 > 150" into "a > 160"
- 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: 8 Mar 2004 20:42:20 -0000
- Subject: [Bug optimization/14490] New: [tree-ssa] Simplify "a - 10 > 150" into "a > 160"
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider:
void bar (void);
void
foo (int a)
{
if (a < 100)
return;
if (200 < a)
return;
if (a - 10 > 150)
bar ();
}
We know that "a" is between 100 and 200 after the first two ifs.
So we should be able to simplify "a - 10 > 150" into "a > 160".
Here is what I get:
foo (a)
{
int T.0;
<bb 0>:
if (a <= 99) goto <L0>; else goto <L1>;
<L0>:;
return;
<L1>:;
if (a > 200) goto <L2>; else goto <L3>;
<L2>:;
return;
<L3>:;
if (a - 10 > 150) goto <L4>; else goto <L5>;
<L4>:;
bar () [tail call];
<L5>:;
return;
}
--
Summary: [tree-ssa] Simplify "a - 10 > 150" into "a > 160"
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
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=14490