aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr100794.c
blob: 6f707ae7fba30826ea69757e7b04ca390eee8de4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-loop-vectorize -fdump-tree-pcom-details -fdisable-tree-vect" } */

extern double arr[100];
extern double foo (double, double);
extern double sum;

void
test (int i_0, int i_n)
{
  int i;
  for (i = i_0; i < i_n - 1; i++)
    {
      double a = arr[i];
      double b = arr[i + 1];
      sum += a * b;
    }
}

/* { dg-final { scan-tree-dump "Executing predictive commoning without unrolling" "pcom" } } */