OSDN Git Service

PR middle-end/51761
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / compile / pr47428.c
1 /* PR tree-optimization/47428 */
2
3 struct S
4 {
5   int s;
6 } a;
7 int b;
8
9 void bar (struct S);
10
11 int
12 baz (int x __attribute__((unused)), int y)
13 {
14   int i;
15   for (i = 0; i < 1; i = 1)
16     for (y = 0; y < 1; y = 1);
17   return y;
18 }
19
20 void
21 foo (void)
22 {
23   fn (0);
24 }
25
26 int
27 fn (const int x, int y __attribute__((unused)))
28 {
29   if (baz (baz (0, x), 0))
30     return 0;
31   else
32     bar (a);
33   return 0;
34 }
35
36 void
37 bar (struct S x)
38 {
39   for (;;)
40     for (; x.s;)
41       b = 0 ? : baz (0, 0);
42 }