aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-12.c
blob: a221b762e1dce11496de1eee41d315e45084a7db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-phiopt2" } */

int f(int a, int b, int c) {
  if (c > 5) return c;
  if (a == 0) return b;
  return a + b;
}

unsigned rot(unsigned x, int n) {
  const int bits = __CHAR_BIT__ * __SIZEOF_INT__;
  return (n == 0) ? x : ((x << n) | (x >> (bits - n)));
}

unsigned m(unsigned a, unsigned b) {
  if (a == 0)
    return 0;
  else
    return a & b;
}

/* { dg-final { scan-tree-dump-times "goto" 2 "phiopt2" } } */