aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/loop-unswitch-6.c
blob: 36dc31ac51221e5c40a6a9ba887ac5c13e57c260 (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
29
30
31
32
33
/* { dg-do compile } */
/* { dg-options "-O2 -funswitch-loops -g -fdump-tree-unswitch-details" } */
/* { dg-additional-options "-fcompare-debug" { target { ! powerpc-ibm-aix* } } } */

short a, d;
int b, c;
static int e() {
  int f = -2L, g = 9, h = 0;
  for (; h < 2; h++)
    if (a <= 5) {
      g = 0;
      if (c && a)
        break;
      if (c - 1)
        goto i;
    }
  if (b) {
    int *j[] = {&f};
    if (d)
      for (; f < 9; f++)
        if (g)
          for (; f; f++)
            ;
  i:
    while (f) {
      a--;
      break;
    }
  }
}
int main() { e(); }

/* { dg-final { scan-tree-dump-times "Guard hoisted" 1 "unswitch" } } */