[Bug optimization/14490] New: [tree-ssa] Simplify "a - 10 > 150" into "a > 160"
kazu at cs dot umass dot edu
gcc-bugzilla@gcc.gnu.org
Mon Mar 8 20:42:00 GMT 2004
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
More information about the Gcc-bugs
mailing list