Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.dg / tree-ssa / pr22117.c
blobd265d5e2c13eb67fe291d62d94f46b2154bef413
1 /* PR tree-optimization/22117
2 VRP used think that &p[q] is nonzero even though p and q are both
3 known to be zero after entering the first two "if" statements. */
5 /* { dg-do compile } */
6 /* { dg-options "-O2 -fdump-tree-vrp1" } */
8 void
9 foo (int *p, int q)
11 if (p == 0)
13 if (q == 0)
15 int *r = &p[q];
16 if (r != 0)
17 link_error ();
22 /* { dg-final { scan-tree-dump-times "Folding predicate r_.* != 0B to 0" 1 "vrp1" } } */
23 /* { dg-final { cleanup-tree-dump "vrp1" } } */