OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20011126-2.c] - Diff between revs 149 and 154

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
/* Problem originally visible on ia64.
/* Problem originally visible on ia64.
 
 
   There is a partial redundancy of "in + 1" that makes GCSE want to
   There is a partial redundancy of "in + 1" that makes GCSE want to
   transform the final while loop to
   transform the final while loop to
 
 
     p = in + 1;
     p = in + 1;
     tmp = p;
     tmp = p;
     ...
     ...
     goto start;
     goto start;
   top:
   top:
     tmp = tmp + 1;
     tmp = tmp + 1;
   start:
   start:
     in = tmp;
     in = tmp;
     if (in < p) goto top;
     if (in < p) goto top;
 
 
   We miscalculate the number of loop iterations as (p - tmp) = 0
   We miscalculate the number of loop iterations as (p - tmp) = 0
   instead of (p - in) = 1, which results in overflow in the doloop
   instead of (p - in) = 1, which results in overflow in the doloop
   optimization.  */
   optimization.  */
 
 
static const char *
static const char *
test (const char *in, char *out)
test (const char *in, char *out)
{
{
  while (1)
  while (1)
    {
    {
      if (*in == 'a')
      if (*in == 'a')
        {
        {
          const char *p = in + 1;
          const char *p = in + 1;
          while (*p == 'x')
          while (*p == 'x')
            ++p;
            ++p;
          if (*p == 'b')
          if (*p == 'b')
            return p;
            return p;
          while (in < p)
          while (in < p)
            *out++ = *in++;
            *out++ = *in++;
        }
        }
    }
    }
}
}
 
 
int main ()
int main ()
{
{
  char out[4];
  char out[4];
  test ("aab", out);
  test ("aab", out);
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.