1 /* { dg-do run { target fpic } } */ 2 /* { dg-options "-O2 -fPIC" } */ 3 4 static int heap[2*(256 +1+29)+1]; 5 static int heap_len; 6 static int heap_max; 7 void 8 __attribute__ ((noinline)) foo(int elems)9foo (int elems) 10 { 11 int n, m; 12 int max_code = -1; 13 int node = elems; 14 heap_len = 0, heap_max = (2*(256 +1+29)+1); 15 for (n = 0; n < elems; n++) 16 heap[++heap_len] = max_code = n; 17 do { 18 n = heap[1]; 19 heap[1] = heap[heap_len--]; 20 m = heap[1]; 21 heap[--heap_max] = n; 22 heap[--heap_max] = m; 23 } while (heap_len >= 2); 24 } 25 26 int main()27main () 28 { 29 foo (286); 30 return 0; 31 } 32