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/] [pr15262-2.c] - Diff between revs 149 and 154

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

Rev 149 Rev 154
/* PR 15262.  Similar to pr15262-1.c but with no obvious addresses
/* PR 15262.  Similar to pr15262-1.c but with no obvious addresses
   being taken in function foo().  Without IPA, by only looking inside
   being taken in function foo().  Without IPA, by only looking inside
   foo() we cannot tell for certain whether 'q' and 'b' alias each
   foo() we cannot tell for certain whether 'q' and 'b' alias each
   other.  */
   other.  */
struct A
struct A
{
{
  int t;
  int t;
  int i;
  int i;
};
};
 
 
struct B
struct B
{
{
  int *p;
  int *p;
  float b;
  float b;
};
};
 
 
float X;
float X;
 
 
foo (struct B b, struct A *q, float *h)
foo (struct B b, struct A *q, float *h)
{
{
  X += *h;
  X += *h;
  *(b.p) = 3;
  *(b.p) = 3;
  q->t = 2;
  q->t = 2;
  return *(b.p);
  return *(b.p);
}
}
 
 
main()
main()
{
{
  struct A a;
  struct A a;
  struct B b;
  struct B b;
 
 
  b.p = &a.t;
  b.p = &a.t;
  if (foo (b, &a, &X) == 3)
  if (foo (b, &a, &X) == 3)
    abort ();
    abort ();
 
 
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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