summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr89679.c
blob: 0d6e2d2c871668775ef7ad610651590d786f1ecb (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
/* PR rtl-optimization/89679 */
/* { dg-do run } */
/* { dg-options "-Og -frerun-cse-after-loop -fno-tree-fre" } */

unsigned short g;

void
foo (unsigned long long x)
{
  if (x != 0xffff)
    __builtin_abort ();
}

int
main ()
{
#if __SIZEOF_SHORT__ == 2 && __SIZEOF_INT__ == 4 && __CHAR_BIT__ == 8
  unsigned short d = 0;
  unsigned long long x, c = ~0;
  c = c >> d;
  __builtin_memset (&d, c, 2);
  x = d + g;
  foo (x);
#endif
  return 0;
}