summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr22018.c
blob: d4d332c2fc96ccd0dd970cd4cdbbf5f885806d91 (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
/* { dg-do run }  */
/* { dg-options -O2 }  */

void abort (void);
void g(int);
void f(int l)
{
  unsigned i;
  for (i = 0; i < l; i++)
    {
      int y = i;
      /* VRP was wrongfully computing z's range to be [0, 0] instead
	 of [-INF, 0].  */
      int z = y*-32;
      g(z);
    }
}

void g(int i)
{
  static int x = 0;
  if (i == 0)
    x ++;
  if (x > 1)
    abort ();
}

int main(void)
{
  f(3);
  return 0;
}