aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-21.c
blob: 1123b3ebbdf036f49aad42190494938e17af735d (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
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-thread2-stats -fdump-tree-optimized -fno-ssa-phiopt" } */

long a;
int b;
void bar64_(void);
void foo();
int main() {
  char c = 0;
  unsigned d = 10;
  int e = 2;
  for (; d; d--) {
    bar64_();
    b = d;
    e && (c = (e = 0) != 4) > 1;
  }
  if (c < 1)
    foo();
  a = b;
}

/* Disable phiopt as the threading opportunity  goes away. */
/* We need to perform a non-multi-way branch FSM thread creating an
   irreducible loop in thread2 to allow followup threading to
   remove the call to foo ().  */
/* { dg-final { scan-tree-dump "Jumps threaded: 1" "thread2" } } */
/* { dg-final { scan-tree-dump-not "foo" "optimized" } } */