aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr81020.c
blob: 4c70236d88fa3d0f517f5c93e17ad965621a4069 (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
/* PR rtl-optimization/81020 */
/* { dg-do run } */
/* { dg-options "-O -fno-tree-bit-ccp -fno-tree-coalesce-vars -fno-tree-vrp" } */

unsigned v = 4;

unsigned long long __attribute__((noipa))
foo (unsigned x)
{
#if __SIZEOF_INT__ == 2
  __UINT32_TYPE__ a = v;
#else
  unsigned a = v;
#endif
  a &= 1;
  x |= 0 < a;
  a >>= 31;
  return x + a;
}

int
main ()
{
  if (foo (2) != 2)
    __builtin_abort ();
  return 0;
}