aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-6.c
blob: 90abc8debc9ee6d5ac2f73e597e6a52baba175f7 (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
34
35
36
37
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-ifcombine" } */

void bar (void);

void
foo1 (unsigned int a)
{
  if (a & 1)
    goto heaven;
  if (a & 4)
    goto heaven;
  return;

 heaven:
  bar ();
}

void
foo2 (unsigned int a)
{
  if (a & 1)
    if (a & 4)
      goto heaven;
  return;

 heaven:
  bar ();
}


/* The special treatment of a & 1 != 0 in fold caused the pattern not
   to be recognized due to extra conversions inserted.  */

/* { dg-final { scan-tree-dump "optimizing bits or bits test" "ifcombine" } } */
/* { dg-final { scan-tree-dump "optimizing double bit test" "ifcombine" } } */
/* { dg-final { cleanup-tree-dump "ifcombine" } } */