summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr83480.c
blob: 7b57712eaee4d405e2d9c14fa44bf3ee940f6341 (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
/* PR debug/83480 */
/* { dg-do compile } */
/* { dg-options "-O2 -g -fselective-scheduling2 -ftree-vectorize -freorder-blocks-algorithm=simple -fnon-call-exceptions -fno-guess-branch-probability -fno-peephole2 -fno-tree-sink -fno-tree-scev-cprop" } */

signed char a, b;

void
foo (int x, int y)
{
  for (a = 1; a != 0; ++a)
    ;

  for (;;)
    {
      int c;

      b %= (y != 0 && a != 0) + 1;
      if (a != 0)
	y = b;

      for (c = 0; c < 50; ++c)
	++x;

      if (a < 1)
	{
	  while (x != 0)
	    ;

	  a /= 0;	/* { dg-warning "division by zero" } */
	}
    }
}