1 
2 typedef __SIZE_TYPE__ size_t;
3 typedef unsigned int index_ty;
4 typedef index_ty *index_list_ty;
5 
6 struct mult_index
7 {
8   index_ty index;
9   unsigned int count;
10 };
11 
12 struct mult_index_list
13 {
14   struct mult_index *item;
15   size_t nitems;
16   size_t nitems_max;
17 
18   struct mult_index *item2;
19   size_t nitems2_max;
20 };
21 
22 int __attribute__((noinline))
hash_find_entry(size_t * result)23 hash_find_entry (size_t *result)
24 {
25     *result = 2;
26     return 0;
27 }
28 
29 extern void abort (void);
30 struct mult_index * __attribute__((noinline))
foo(size_t n)31 foo (size_t n)
32 {
33   static count = 0;
34   if (count++ > 0)
35     abort ();
36   return 0;
37 }
38 
39 int
main(void)40 main (void)
41 {
42     size_t nitems = 0;
43 
44     for (;;)
45     {
46         size_t list;
47 
48         hash_find_entry (&list);
49         {
50             size_t len2 = list;
51             struct mult_index *destptr;
52             struct mult_index *dest;
53             size_t new_max  = nitems + len2;
54 
55             if (new_max != len2)
56                 break;
57             dest = foo (new_max);
58 
59             destptr = dest;
60             while (len2--)
61                 destptr++;
62 
63             nitems = destptr - dest;
64         }
65     }
66 
67     return 0;
68 }
69