This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/14753] [tree-ssa] some missed forward propagation opportunities


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]