re PR tree-optimization/22018 (VRP miscompiles multiply)
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr22018.c
blobd4d332c2fc96ccd0dd970cd4cdbbf5f885806d91
1 /* { dg-do run } */
2 /* { dg-options -O2 } */
4 void abort (void);
5 void g(int);
6 void f(int l)
8 unsigned i;
9 for (i = 0; i < l; i++)
11 int y = i;
12 /* VRP was wrongfully computing z's range to be [0, 0] instead
13 of [-INF, 0]. */
14 int z = y*-32;
15 g(z);
19 void g(int i)
21 static int x = 0;
22 if (i == 0)
23 x ++;
24 if (x > 1)
25 abort ();
28 int main(void)
30 f(3);
31 return 0;