aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr104459.c
blob: de8a643d9e218f1c4dbb53d59727bee1267b8f51 (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
29
30
31
32
33
34
35
36
37
38
/* PR rtl-optimization/104459 */
/* { dg-do compile } */
/* { dg-options "-O2 -funswitch-loops -fno-tree-dce -fcompare-debug -w" } */

void
foo (int x, int y)
{
  unsigned int a;

  for (;;)
    {
      short int *p = (short int *) &x;
      unsigned int q = 0;

      a /= 2;
      if (a)
	{
	  q -= y;
	  while (q)
	    ;
	}

      if (x)
	{
	  for (q = 0; q != 1; q += 2)
	    {
	      unsigned int n;

	      n = *p ? 0 : q;
	      y += n < 1;

	      n = a || *p;
	      if (n % x == 0)
		y /= x;
	    }
	}
    }
}