summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr31959.c
blob: f8090f45cc025e04194662576d31881d9a807338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* PR middle-end/31959 */
/* { dg-do compile } */
/* { dg-options "-O0 -fguess-branch-probability" } */

struct A { int i; };

static inline struct A *
bar (struct A *x)
{
  return x;
}

void *
foo (struct A *x, int y)
{
  void *p = (void *) 0;
  if (__builtin_expect (y >= 6, 0))
    p = bar (x);
  return p;
}