2018-04-30 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr63586.c
blob470be8cea9e55ac2c0e626e92717f4ad99df4a70
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-reassoc1" } */
4 unsigned f1 (unsigned x, unsigned z)
6 unsigned y = x + z;
7 y = y + x;
8 y = y + x;
9 y = y + x;
10 y = y + x;
11 y = y + x;
12 y = y + x;
13 return y;
16 /* { dg-final { scan-tree-dump-times "\\\* 7" 1 "reassoc1" } } */
18 unsigned f2 (unsigned x, unsigned z)
20 unsigned y = x + z;
21 y = y + x;
22 y = y + x;
23 y = y + x;
24 y = y + z;
25 y = y + z;
26 y = y + z;
27 y = y + z;
28 return y;
31 /* { dg-final { scan-tree-dump-times "\\\* 5" 1 "reassoc1" } } */
32 /* { dg-final { scan-tree-dump-times "\\\* 4" 1 "reassoc1" } } */
34 unsigned f3 (unsigned x, unsigned z, unsigned k)
36 unsigned y = x + z;
37 y = y + x;
38 y = y + z;
39 y = y + z;
40 y = y + k;
41 return y;
44 /* { dg-final { scan-tree-dump-times "\\\* 2" 1 "reassoc1" } } */
45 /* { dg-final { scan-tree-dump-times "\\\* 3" 1 "reassoc1" } } */
47 unsigned f4 (unsigned x, unsigned z, unsigned k)
49 unsigned y = k + x;
50 y = y + z;
51 y = y + z;
52 y = y + z;
53 y = y + z;
54 y = y + z;
55 y = y + z;
56 y = y + z;
57 y = y + z;
58 return y;
60 /* { dg-final { scan-tree-dump-times "\\\* 8" 1 "reassoc1" } } */
62 unsigned f5 (unsigned x, unsigned y, unsigned z)
64 return x + y + y + y + y + y \
65 + y + z + z + z + z + z + z + z + z + z;
68 /* { dg-final { scan-tree-dump-times "\\\* 6" 1 "reassoc1" } } */
69 /* { dg-final { scan-tree-dump-times "\\\* 9" 1 "reassoc1" } } */