aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-20.c
blob: bc60a040a70ac031d1ffb4b677591b8174d4aab6 (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
/* { dg-do compile  } */
/* { dg-options "-O2 -fdump-tree-lim2-details" } */

/* Test that `count' is not hoisted out of loop when bb is cold.  */

int count;
volatile int x;

struct obj {
  int data;
  struct obj *next;

} *q;

void
func (int m)
{
  struct obj *p;
  for (int i = 0; i < m; i++)
    if (__builtin_expect (x, 0))
      count++;

}

/* { dg-final { scan-tree-dump-not "Executing store motion of" "lim2"  }  } */