1/* { dg-do compile } */
2/* { dg-options "-O2 -misel -fdump-tree-phiopt-details" } */
3
4typedef struct s {
5  int v;
6  int b;
7  struct s *l;
8  struct s *r;
9} S;
10
11
12int foo(S *s)
13{
14  S *this;
15  S *next;
16
17  this = s;
18  if (this->b)
19    next = this->l;
20  else
21    next = this->r;
22
23  return next->v;
24}
25
26/* { dg-final { scan-tree-dump "Hoisting adjacent loads" "phiopt1" } } */
27/* { dg-final { cleanup-tree-dump "phiopt1" } } */
28