summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/autopar/pr47060.c
blob: e8cdfd6677e38220858be0baf42985533e1554d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* PR tree-optimization/47060 */
/* { dg-do compile } */
/* { dg-options "-O -ffast-math -ftree-parallelize-loops=2 -fno-tree-dce" } */

struct S
{
  int n;
  float *a;
};

float
foo (struct S *b)
{
  float c, d;
  int j;
  for (j = 0; j < b->n; j++)
    d += b->a[j];
  for (j = 0; j < b->n; j++)
    c += b->a[j];
  return d;
}