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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr15262-2.c] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* PR 15262.  Similar to pr15262-1.c but with no obvious addresses
2
   being taken in function foo().  Without IPA, by only looking inside
3
   foo() we cannot tell for certain whether 'q' and 'b' alias each
4
   other.  */
5
struct A
6
{
7
  int t;
8
  int i;
9
};
10
 
11
struct B
12
{
13
  int *p;
14
  float b;
15
};
16
 
17
float X;
18
 
19
foo (struct B b, struct A *q, float *h)
20
{
21
  X += *h;
22
  *(b.p) = 3;
23
  q->t = 2;
24
  return *(b.p);
25
}
26
 
27
main()
28
{
29
  struct A a;
30
  struct B b;
31
 
32
  b.p = &a.t;
33
  if (foo (b, &a, &X) == 3)
34
    abort ();
35
 
36
  return 0;
37
}

powered by: WebSVN 2.1.0

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