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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [20020426-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
/* PR optimization/6475
/* PR optimization/6475
   Distilled from zlib sources.  */
   Distilled from zlib sources.  */
/* { dg-do run } */
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -frename-registers -fomit-frame-pointer -fPIC -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-O2 -frename-registers -fomit-frame-pointer -fPIC -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 } */
/* { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 } */
 
 
extern void exit (int);
extern void exit (int);
 
 
typedef struct
typedef struct
{
{
  union
  union
  {
  {
    struct
    struct
    {
    {
      unsigned char a3;
      unsigned char a3;
      unsigned char a4;
      unsigned char a4;
    } a2;
    } a2;
    unsigned int a5;
    unsigned int a5;
  } a0;
  } a0;
  unsigned int a1;
  unsigned int a1;
} A;
} A;
 
 
static int
static int
foo (unsigned int *b, unsigned int n, unsigned int s, const unsigned int *d,
foo (unsigned int *b, unsigned int n, unsigned int s, const unsigned int *d,
     const unsigned int *e, A **t, unsigned int *m, A *hp, unsigned int *hn,
     const unsigned int *e, A **t, unsigned int *m, A *hp, unsigned int *hn,
     unsigned int *v)
     unsigned int *v)
{
{
  unsigned int a, c[15 + 1], f;
  unsigned int a, c[15 + 1], f;
  int g, h;
  int g, h;
  unsigned int i, j, k;
  unsigned int i, j, k;
  int l;
  int l;
  unsigned int ee;
  unsigned int ee;
  unsigned int *p;
  unsigned int *p;
  A *q, r, *u[15];
  A *q, r, *u[15];
  int w;
  int w;
  unsigned int x[15 + 1], *xx;
  unsigned int x[15 + 1], *xx;
  int y;
  int y;
  unsigned int z;
  unsigned int z;
  p = c;
  p = c;
  *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0;
  *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0;
  *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0;
  *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0;
  *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0;
  *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0;
  *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0;
  *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0;
  p = b;
  p = b;
  i = n;
  i = n;
  do
  do
    c[*p++]++;
    c[*p++]++;
  while (--i);
  while (--i);
  if (c[0] == n)
  if (c[0] == n)
    {
    {
      *t = (A *) 0;
      *t = (A *) 0;
      *m = 0;
      *m = 0;
      return 0;
      return 0;
    }
    }
  l = *m;
  l = *m;
  for (j = 1; j <= 15; j++)
  for (j = 1; j <= 15; j++)
    if (c[j])
    if (c[j])
      break;
      break;
  k = j;
  k = j;
  if ((unsigned int) l < j)
  if ((unsigned int) l < j)
    l = j;
    l = j;
  for (i = 15; i; i--)
  for (i = 15; i; i--)
    if (c[i])
    if (c[i])
      break;
      break;
  g = i;
  g = i;
  if ((unsigned int) l > i)
  if ((unsigned int) l > i)
    l = i;
    l = i;
  *m = l;
  *m = l;
  for (y = 1 << j; j < i; j++, y <<= 1)
  for (y = 1 << j; j < i; j++, y <<= 1)
    if ((y -= c[j]) < 0)
    if ((y -= c[j]) < 0)
      return -3;
      return -3;
  if ((y -= c[i]) < 0)
  if ((y -= c[i]) < 0)
    return -3;
    return -3;
  c[i] += y;
  c[i] += y;
  x[1] = j = 0;
  x[1] = j = 0;
  p = c + 1;
  p = c + 1;
  xx = x + 2;
  xx = x + 2;
  while (--i)
  while (--i)
    *xx++ = (j += *p++);
    *xx++ = (j += *p++);
  p = b;
  p = b;
  i = 0;
  i = 0;
  do
  do
    if ((j = *p++) != 0)
    if ((j = *p++) != 0)
      v[x[j]++] = i;
      v[x[j]++] = i;
  while (++i < n);
  while (++i < n);
  n = x[g];
  n = x[g];
  x[0] = i = 0;
  x[0] = i = 0;
  p = v;
  p = v;
  h = -1;
  h = -1;
  w = -l;
  w = -l;
  u[0] = (A *) 0;
  u[0] = (A *) 0;
  q = (A *) 0;
  q = (A *) 0;
  z = 0;
  z = 0;
  for (; k <= g; k++)
  for (; k <= g; k++)
    {
    {
      a = c[k];
      a = c[k];
      while (a--)
      while (a--)
        {
        {
          while (k > w + l)
          while (k > w + l)
            {
            {
              h++;
              h++;
              w += l;
              w += l;
              z = g - w;
              z = g - w;
              z = z > (unsigned int) l ? l : z;
              z = z > (unsigned int) l ? l : z;
              if ((f = 1 << (j = k - w)) > a + 1)
              if ((f = 1 << (j = k - w)) > a + 1)
                {
                {
                  f -= a + 1;
                  f -= a + 1;
                  xx = c + k;
                  xx = c + k;
                  if (j < z)
                  if (j < z)
                    while (++j < z)
                    while (++j < z)
                      {
                      {
                        if ((f <<= 1) <= *++xx)
                        if ((f <<= 1) <= *++xx)
                          break;
                          break;
                        f -= *xx;
                        f -= *xx;
                      }
                      }
                }
                }
              z = 1 << j;
              z = 1 << j;
              if (*hn + z > 1440)
              if (*hn + z > 1440)
                return -3;
                return -3;
              u[h] = q = hp + *hn;
              u[h] = q = hp + *hn;
              *hn += z;
              *hn += z;
              if (h)
              if (h)
                {
                {
                  x[h] = i;
                  x[h] = i;
                  r.a0.a2.a4 = (unsigned char) l;
                  r.a0.a2.a4 = (unsigned char) l;
                  r.a0.a2.a3 = (unsigned char) j;
                  r.a0.a2.a3 = (unsigned char) j;
                  j = i >> (w - l);
                  j = i >> (w - l);
                  r.a1 = (unsigned int) (q - u[h - 1] - j);
                  r.a1 = (unsigned int) (q - u[h - 1] - j);
                  u[h - 1][j] = r;
                  u[h - 1][j] = r;
                }
                }
              else
              else
                *t = q;
                *t = q;
            }
            }
          r.a0.a2.a4 = (unsigned char) (k - w);
          r.a0.a2.a4 = (unsigned char) (k - w);
          if (p >= v + n)
          if (p >= v + n)
            r.a0.a2.a3 = 128 + 64;
            r.a0.a2.a3 = 128 + 64;
          else if (*p < s)
          else if (*p < s)
            {
            {
              r.a0.a2.a3 = (unsigned char) (*p < 256 ? 0 : 32 + 64);
              r.a0.a2.a3 = (unsigned char) (*p < 256 ? 0 : 32 + 64);
              r.a1 = *p++;
              r.a1 = *p++;
            }
            }
          else
          else
            {
            {
              r.a0.a2.a3 = (unsigned char) (e[*p - s] + 16 + 64);
              r.a0.a2.a3 = (unsigned char) (e[*p - s] + 16 + 64);
              r.a1 = d[*p++ - s];
              r.a1 = d[*p++ - s];
            }
            }
          f = 1 << (k - w);
          f = 1 << (k - w);
          for (j = i >> w; j < z; j += f)
          for (j = i >> w; j < z; j += f)
            q[j] = r;
            q[j] = r;
          for (j = 1 << (k - 1); i & j; j >>= 1)
          for (j = 1 << (k - 1); i & j; j >>= 1)
            i ^= j;
            i ^= j;
          i ^= j;
          i ^= j;
          ee = (1 << w) - 1;
          ee = (1 << w) - 1;
          while ((i & ee) != x[h])
          while ((i & ee) != x[h])
            {
            {
              h--;
              h--;
              w -= l;
              w -= l;
              ee = (1 << w) - 1;
              ee = (1 << w) - 1;
            }
            }
        }
        }
    }
    }
  return y != 0 && g != 1 ? (-5) : 0;
  return y != 0 && g != 1 ? (-5) : 0;
}
}
 
 
unsigned int a[19] = { 3, 4, 0, 2, 2, [17] = 3, 3 };
unsigned int a[19] = { 3, 4, 0, 2, 2, [17] = 3, 3 };
unsigned int d[19];
unsigned int d[19];
A h[1440];
A h[1440];
 
 
int
int
main (void)
main (void)
{
{
  unsigned int b = 0, c = 0;
  unsigned int b = 0, c = 0;
  A *e = 0;
  A *e = 0;
  foo (a, 19, 19, 0, 0, &e, &b, h, &c, d);
  foo (a, 19, 19, 0, 0, &e, &b, h, &c, d);
  exit (0);
  exit (0);
}
}
 
 

powered by: WebSVN 2.1.0

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