aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr104645.c
blob: 83c1dd451f19eead5f6c0004cd97fcceee7f9383 (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
/* PR tree-optimization/104645 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-final { scan-tree-dump-not " = PHI <" "optimized" } } */

int
foo (unsigned i)
{
  return i ? i % 2 : 0;
}

int
bar (unsigned i)
{
  int b = 0;
  if (i)
    {
      unsigned a = i & 1;
      b = a;
    }
  return b;
}

int
baz (unsigned i)
{
  return i ? i + 4 : 4;
}