summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/loop-unswitch-2.c
blob: f8d314e34de28714325646ebe356596ad1cc7dea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-details" } */

void foo (float **a, float **b, float *c, int n, int m, int l)
{
  int i,j,k;
  float s;
  for (i=0; i<l; i++)
    for (j=0; j<n; j++)
      for (k=0; k<m; k++)
	c[i] += a[i][k] * b[k][j];
}

/* { dg-final { scan-tree-dump-times "guard hoisted" 3 "unswitch" } } */
/* { dg-final { scan-tree-dump-not "Invalid sum" "unswitch" } } */