aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/restrict-5.c
blob: d6c240aae0340ad380bada2a92e28d2de790e222 (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
/* { dg-do compile } */
/* { dg-options "-O -fno-strict-aliasing -fdump-tree-lim1-details" } */

static inline __attribute__((always_inline))
void f(int * __restrict__ r,
       int a[__restrict__ 16][16],
       int b[__restrict__ 16][16],
       int i, int j)
{
  int x;
  *r = 0;
  for (x = 1; x < 16; ++x)
    *r = *r + a[i][x] * b[x][j];
}

void g(int *r, int a[16][16], int b[16][16], int i, int j)
{
  f (r, a, b, i ,j);
}

/* We should apply store motion to the store to *r.  */

/* { dg-final { scan-tree-dump "Executing store motion of \\\*r" "lim1" } } */
/* { dg-final { cleanup-tree-dump "lim1" } } */