OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.dg/] [20030826-2.c] - Diff between revs 298 and 384

Only display areas with differences | Details | Blame | View Log

Rev 298 Rev 384
/* { dg-do run } */
/* { dg-do run } */
/* { dg-options "-O2 -fomit-frame-pointer" } */
/* { dg-options "-O2 -fomit-frame-pointer" } */
/* { dg-options "-O2 -fomit-frame-pointer -march=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
 
 
extern void abort (void);
extern void abort (void);
extern void exit (int);
extern void exit (int);
 
 
struct S
struct S
{
{
  int *a;
  int *a;
  unsigned char *b, c;
  unsigned char *b, c;
};
};
 
 
int u, v, w;
int u, v, w;
 
 
void
void
foo (unsigned short x)
foo (unsigned short x)
{
{
  u += x;
  u += x;
}
}
 
 
int
int
bar (struct S **x, int *y)
bar (struct S **x, int *y)
{
{
  w += *y;
  w += *y;
  *y = w + 25;
  *y = w + 25;
  return 0;
  return 0;
}
}
 
 
int
int
baz (struct S **x)
baz (struct S **x)
{
{
  struct S *y = *x;
  struct S *y = *x;
  unsigned char *a = y->b;
  unsigned char *a = y->b;
 
 
  foo (*a);
  foo (*a);
 
 
  if (__builtin_expect (y->c != 0 || y->a == &v, 0))
  if (__builtin_expect (y->c != 0 || y->a == &v, 0))
    return 1;
    return 1;
 
 
  if (__builtin_expect (*a == 1, 0))
  if (__builtin_expect (*a == 1, 0))
    {
    {
      int a, b = bar (x, &a);
      int a, b = bar (x, &a);
 
 
      if (a)
      if (a)
        return b;
        return b;
    }
    }
 
 
  return 0;
  return 0;
}
}
 
 
int
int
main (void)
main (void)
{
{
  struct S a, *b = &a;
  struct S a, *b = &a;
  unsigned char c;
  unsigned char c;
 
 
  __builtin_memset (b, 0, sizeof (a));
  __builtin_memset (b, 0, sizeof (a));
  a.a = &v;
  a.a = &v;
  a.b = &c;
  a.b = &c;
  if (baz (&b) != 1)
  if (baz (&b) != 1)
    abort ();
    abort ();
  exit (0);
  exit (0);
}
}
 
 

powered by: WebSVN 2.1.0

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