aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/modref-8.c
blob: c51590ff0ba1903d228c5ce5d2a2e8f1c2cb5dd9 (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
25
/* { dg-options "-O2 --param modref-max-adjustments=8 -fdump-tree-modref1 -fno-optimize-sibling-calls"  } */
/* { dg-do compile } */
void
set (char *p)
{
   p[1]=1;
   p[0]=0;
   p[2]=2;
   p[4]=4;
   p[3]=3;
}

void
recurse (char *p, int n)
{
	*p = 0;
	if (n)
	  recurse (p+1,n-1);
}
/* { dg-final { scan-tree-dump-not "--param modref-max-accesses" "modref1" } } */
/* { dg-final { scan-tree-dump "--param modref-max-adjustments" "modref1" } } */
/* In set all accesses should merge together.  */
/* { dg-final { scan-tree-dump "access: Parm 0 param offset:0 offset:0 size:8 max_size:40" "modref1" } } */
/* In recurse we should cap the recrusion after 8 attempts and set max_size to -1.  */
/* { dg-final { scan-tree-dump "access: Parm 0 param offset:0 offset:0 size:8 max_size:-1 adjusted 8 times" "modref1" } } */