aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr103220-2.c
blob: 25d7412a0958cf0a78c8885daea2ca3e0ebe2014 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
signed char f(unsigned char a)
{
  unsigned char b = a & 127;
  signed char c = (signed char) b;
  signed char d = (signed char) a;
  signed char e = d & -128;
  signed char h = c | e;
  return h;
}
/* The above should reduce down to just return with a cast.
   removing the two &s there and |'s. */
/* { dg-final { scan-tree-dump-times "& 127" 0 "optimized"} } */
/* { dg-final { scan-tree-dump-times "& -128" 0 "optimized"} } */
/* { dg-final { scan-tree-dump-times "\\\| " 0 "optimized"} } */