aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr61607.c
blob: 0868a4459dcdc019be60480e91c9d45b482ab5c8 (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
/* { dg-do compile } */
/* { dg-options "-Os -fno-tree-fre -fdump-tree-dom2" } */

void foo(int *);
void f2(int dst[3], int R)
{
  int i, inter[2];
  _Bool inter0p = 0;
  _Bool inter1p = 0;
  for (i = 1; i < R; i++)
    {
      inter0p = 1;
      inter1p = 1;
    }
  if (inter0p)
    inter[0] = 1;
  if (inter1p)
    inter[1] = 1;
  foo(inter);
}


/* There should be precisely two conditionals.  One for the loop condition
   and one for the test after the loop.  Previously we failed to eliminate
   the second conditional after the loop.  */
/* { dg-final { scan-tree-dump-times "if" 2 "dom2"} } */