summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/autopar/pr46099.c
blob: 074278e644b503bfe57bbdf9796ba3b013c4a2ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* PR tree-optimization/46099 */
/* { dg-do compile } */
/* { dg-options "-ftree-parallelize-loops=2 -fcompare-debug -O" } */

static inline void
bar (int *i)
{
  int j = *i;
}

void baz (int *, int *, int *);

void
f1 (int n)
{
  int i;
  for (i = 0; i < n; i++)
    bar (&i);
}

void
f2 (int n)
{
  int i;
  int a[10000], b[10000], c[10000];
  baz (a, b, c);
  for (i = 0; i < n; i++)
    {
      void *p = c;
      a[i] = b[i] + c[i];
    }
  baz (a, b, c);
}

void
f3 (int n)
{
  int i;
  int a[10000], b[10000], c[10000];
  baz (a, b, c);
  for (i = 0; i < n; i++)
    {
      a[i] = b[i] + c[i];
      void *p = c;
    }
  baz (a, b, c);
}