summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr52267.c
blob: 8362dc23c040f058371bfc93363396371b80ed9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* PR tree-optimization/52267 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */

int
foo (int a, int b)
{
  if (a > 3 || a < 0)
    return a;
  a &= 3;
  return a & 3;
}

int
bar (int a)
{
  if (a & ~3)
    return a;
  return a & 3;
}

/* { dg-final { scan-tree-dump-not "& 3" "optimized" } } */
/* { dg-final { scan-tree-dump-not "& -4" "optimized" } } */