Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/pr46777.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* PR rtl-optimization/46777 */ | |
2 /* { dg-do compile } */ | |
3 /* { dg-options "-fgcse -O -fno-tree-dominator-opts -funroll-loops" } */ | |
4 | |
5 struct S { char s[256]; }; | |
6 | |
7 static inline int | |
8 foo (int x, int y) | |
9 { | |
10 switch (x) | |
11 { | |
12 case 1: | |
13 case 2: | |
14 return 3; | |
15 case 3: | |
16 case 4: | |
17 return 2; | |
18 case 5: | |
19 switch (y) | |
20 { | |
21 case 4: | |
22 return 1; | |
23 } | |
24 } | |
25 return 0; | |
26 } | |
27 | |
28 void | |
29 bar (struct S *x, int *y, int *z, int **w) | |
30 { | |
31 switch (*y ? x->s[*y] : foo (y[1], y[0])) | |
32 { | |
33 case 3: | |
34 if (y + 2 == z) | |
35 for (;;) | |
36 { | |
37 y += 2; | |
38 switch (*y ? x->s[*y] : foo (y[1], y[0])) | |
39 { | |
40 case 6: | |
41 break; | |
42 default: | |
43 *w = y; | |
44 } | |
45 if (y == z) | |
46 break; | |
47 } | |
48 } | |
49 } |