summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/fold-masked-cmp-3.c
blob: 5531c359b813abd3edf83ab33e20f267c08bde51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-fdump-tree-original" } */

void foo (int *p, int x)
{
  if ((x & 0xff) <= 7)
    *p = 0;
}

void bar (int *p, int x)
{
  if ((x & 0xff) < 8)
    *p = 0;
}

/* { dg-final { scan-tree-dump-times "(x & .*) == 0" 2 "original" } } */