1/* PR middle-end/26300 */
2
3struct S
4{
5  char c;
6  struct S *d;
7  struct S *e;
8};
9extern struct S *u, *v;
10extern void fn1 (struct S *) __attribute__ ((noreturn));
11void fn2 (struct S *);
12
13static inline struct S *
14fn3 (struct S *x)
15{
16  if (x->c != 6)
17    fn1 (0);
18  return (struct S *) x;
19}
20
21static inline int
22fn4 (struct S *x)
23{
24  if (x != u)
25    return 3;
26  fn2 (x);
27  return 0;
28}
29
30int
31test (struct S *x)
32{
33  struct S *r;
34  int m = 0;
35
36  for (r = x; r != v; r = (fn3 (r)->d))
37    if (r->c != 6)
38      fn1 (x);
39    else
40      m |= 1 << (fn4 (fn3 (r)->e) - 1);
41  return m;
42}
43