This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14753] [tree-ssa] some missed forward propagation opportunities
- 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: 29 Mar 2004 02:10:02 -0000
- Subject: [Bug optimization/14753] [tree-ssa] some missed forward propagation opportunities
- References: <20040327161347.14753.kazu@cs.umass.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From kazu at cs dot umass dot edu 2004-03-29 02:09 -------
A slightly more comprehensive list of missing cases.
I am not showing reversed conditions for conciseness.
void bar (void);
void
rshift_gt (unsigned int a)
{
/* This is equivalent to a >= 23. */
if ((a >> 2) > 5)
bar ();
}
void
rshift_eq (unsigned int a)
{
/* This is equivalent to a <= 3. */
if ((a >> 2) == 0)
bar ();
}
void
mask_eq (unsigned int a)
{
/* This is equivalent to a <= 7. */
if ((a & ~7) == 0)
bar ();
}
void
mask_gt (unsigned int a)
{
/* This is equivalent to a > 15. */
if ((a & ~7) > 8)
bar ();
}
void
not_eq_cst (unsigned int a)
{
a = ~a;
if (a == 123)
bar ();
}
void
not_eq_var (unsigned int a, unsigned int b)
{
a = ~a;
b = ~b;
if (a == b)
bar ();
}
void
neg_eq_cst (unsigned int a)
{
a = -a;
if (a == 123)
bar ();
}
void
neg_eq_var (unsigned int a, unsigned int b)
{
a = -a;
b = -b;
if (a == b)
bar ();
}
void
minus_vars (unsigned int a, unsigned int b)
{
unsigned int tem;
tem = a - b;
if (tem == 0)
bar ();
}
void
xor_vars (unsigned int a, unsigned int b)
{
unsigned int tem;
tem = a ^ b;
if (tem == 0)
bar ();
}
void
xor_cst (unsigned int a)
{
a ^= 123;
if (a == 456)
bar ();
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14753