view gcc/testsuite/gcc.dg/tree-ssa/restrict-5.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-O -fno-strict-aliasing -fdump-tree-lim2-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" "lim2" } } */