aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/predcom-7.c
blob: 99939767562221036b8ef0ce45a80e19d01da2cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do run } */
/* { dg-options "-O3 -fdump-tree-pcom-details-blocks" } */

int b, f, d[5][2];
unsigned int c;

int
main ()
{
  for (c = 0; c < 2; c++)
    if (d[b + 3][c] & d[b + 4][c])
      if (f)
	break;
  return 0;
}

/* { dg-final { scan-tree-dump "Executing predictive commoning" "pcom" } } */
/* dom pass introduces one mismatch after simplfying mispredicted conditional
   on c being non-zero on first iteration.  This happens since c is global variable
   and needs alias analysis.  */
/* { dg-final { scan-tree-dump-times "Invalid sum" 1 "pcom" } } */