aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c
blob: 55887a694dc12f7dd216fc2950f999550c4defc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* PR37997 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre-details" } */

int foo (int i, int b, int result)
{
  int mask;
  if (b)
    mask = -2;
  else
    mask = 0;
  result = i + 1;
  result = result & mask;
  return result;
}

/* We should insert i + 1 into the if (b) path as well as the simplified
   i + 1 & -2 expression.  And do replacement with two PHI temps.  */

/* { dg-final { scan-tree-dump-times "with prephitmp" 2 "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */