1 /* PR target/63542 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -g -dA" } */
4 /* { dg-additional-options "-fpic" { target fpic } } */
5 
6 struct B { unsigned long c; unsigned char *d; };
7 extern struct A { struct B *e[0x400]; } *f[128];
8 extern void (*bar) (char *p, char *q);
9 
10 char *
foo(char * p,char * q)11 foo (char *p, char *q)
12 {
13   struct B *g;
14   char *b, *l;
15   unsigned long s;
16 
17   g = f[((unsigned long) p) >> 22]->e[(((unsigned long) p) >> 12) & 0x3ff];
18   s = g->c << 2;
19   int r = ((unsigned long) p) & 0xfff;
20   int m = g->d[r];
21   if (m > 0xfd)
22     {
23       m = (r >> 2) % (s >> 2);
24       if ((((unsigned long) p) & ~(unsigned long) 0xfff) != (((unsigned long) q) & ~(unsigned long) 0xfff))
25 	goto fail;
26     }
27   b = (char *) ((unsigned long) p & ~(unsigned long) 3);
28   b -= m << 2;
29   l = b + s;
30 
31   if ( q >= l || q < b)
32     goto fail;
33   return p;
34 fail:
35   (*bar) (p, q);
36   return p;
37 }
38