aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-41.c
blob: 2c9d90880b8fb4532a7bbf96e0aa5a84b0b1d532 (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
/* Verify straight-line strength reduction in using
   alternative base expr to record and look for the
   potential candidate.  */

/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-slsr-details" } */

typedef int arr_2[50][50];

void foo (arr_2 a2, int v1)
{
  int i, j;

  i = v1 + 5;
  j = i;
  a2 [i-10] [j] = 2;
  a2 [i] [j++] = i;
  a2 [i+20] [j++] = i;
  a2 [i-3] [i-1] += 1;
  return;
}

/* { dg-final { scan-tree-dump-times "Replacing reference: " 5 "slsr" } } */
/* { dg-final { cleanup-tree-dump "slsr" } } */