aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/mips/pr54240.c
blob: cedb97a6ac2aedf812d3cb0e0292e53caf9e19aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* { dg-do compile } */
/* { dg-options "-fdump-tree-phiopt-details -ffat-lto-objects isa>=4" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" "-O1" } { "" } } */

typedef struct s {
  int v;
  int b;
  struct s *l;
  struct s *r;
} S;

/* Test requires conditional moves.  */
NOMIPS16 int foo(S *s)
{
  S *this;
  S *next;

  this = s;
  if (this->b)
    next = this->l;
  else
    next = this->r;

  return next->v;
}

/* { dg-final { scan-tree-dump "Hoisting adjacent loads" "phiopt1" } } */
/* { dg-final { cleanup-tree-dump "phiopt1" } } */