Doc: Add Standard-Names ustrunc and sstrunc for integer modes
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipa-sra-4.c
blob5b42fbd83298befb48f7282cc02ec877d03a9ed0
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fipa-sra -fno-ipa-pure-const -fdump-ipa-sra -fno-ipa-modref" } */
4 static int
5 __attribute__((noinline))
6 ox (int *i)
8 return *i+4**i;
11 int *holder;
13 static int
14 __attribute__((noinline))
15 ox_ctrl_1 (int *j)
17 holder = j;
18 return *j+4 * *j+1;
21 static void
22 __attribute__((noinline))
23 ox_ctrl_2 (int *k)
25 *k = 8;
28 static int zzz[10];
30 static int
31 __attribute__((noinline))
32 ox_improved (int recurse, int *l)
34 int r = 0;
36 r = *l;
38 if (recurse)
40 if (recurse > 2)
41 l = &zzz[3];
42 else
43 l = zzz;
45 ox_improved (0, l);
48 return r;
51 void caller (void)
53 int a = 1;
54 int b = 10;
55 int c;
57 c = ox (&a);
58 ox_ctrl_1 (&a);
59 ox_ctrl_2 (&a);
60 *holder = ox_improved (1, &b) + c;
61 return;
64 /* { dg-final { scan-ipa-dump-times "Will split parameter" 2 "sra" } } */