OSDN Git Service

* bitmap.c, bitmap.h, builtin-attrs.def, cfglayout.h,
[pf3gnuchains/gcc-fork.git] / gcc / bitmap.c
1 /* Functions to support general ended bitmaps.
2    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004
3    Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.  */
21
22 #include "config.h"
23 #include "system.h"
24 #include "coretypes.h"
25 #include "tm.h"
26 #include "rtl.h"
27 #include "flags.h"
28 #include "obstack.h"
29 #include "ggc.h"
30 #include "bitmap.h"
31
32 /* Obstack to allocate bitmap elements from.  */
33 static struct obstack bitmap_obstack;
34 static int bitmap_obstack_init = FALSE;
35 \f
36 #ifndef INLINE
37 #ifndef __GNUC__
38 #define INLINE
39 #else
40 #define INLINE __inline__
41 #endif
42 #endif
43
44 /* Global data */
45 bitmap_element bitmap_zero_bits;        /* An element of all zero bits.  */
46 static bitmap_element *bitmap_free;     /* Freelist of bitmap elements.  */
47 static GTY((deletable)) bitmap_element *bitmap_ggc_free;
48
49 static void bitmap_elem_to_freelist (bitmap, bitmap_element *);
50 static void bitmap_element_free (bitmap, bitmap_element *);
51 static bitmap_element *bitmap_element_allocate (bitmap);
52 static int bitmap_element_zerop (bitmap_element *);
53 static void bitmap_element_link (bitmap, bitmap_element *);
54 static bitmap_element *bitmap_find_bit (bitmap, unsigned int);
55 \f
56 /* Add ELEM to the appropriate freelist.  */
57 static INLINE void
58 bitmap_elem_to_freelist (bitmap head, bitmap_element *elt)
59 {
60   if (head->using_obstack)
61     {
62       elt->next = bitmap_free;
63       bitmap_free = elt;
64     }
65   else
66     {
67       elt->next = bitmap_ggc_free;
68       bitmap_ggc_free = elt;
69     }
70 }
71
72 /* Free a bitmap element.  Since these are allocated off the
73    bitmap_obstack, "free" actually means "put onto the freelist".  */
74
75 static INLINE void
76 bitmap_element_free (bitmap head, bitmap_element *elt)
77 {
78   bitmap_element *next = elt->next;
79   bitmap_element *prev = elt->prev;
80
81   if (prev)
82     prev->next = next;
83
84   if (next)
85     next->prev = prev;
86
87   if (head->first == elt)
88     head->first = next;
89
90   /* Since the first thing we try is to insert before current,
91      make current the next entry in preference to the previous.  */
92   if (head->current == elt)
93     {
94       head->current = next != 0 ? next : prev;
95       if (head->current)
96         head->indx = head->current->indx;
97     }
98   bitmap_elem_to_freelist (head, elt);
99 }
100 \f
101 /* Allocate a bitmap element.  The bits are cleared, but nothing else is.  */
102
103 static INLINE bitmap_element *
104 bitmap_element_allocate (bitmap head)
105 {
106   bitmap_element *element;
107
108   if (head->using_obstack)
109     {
110       if (bitmap_free != 0)
111         {
112           element = bitmap_free;
113           bitmap_free = element->next;
114         }
115       else
116         {
117           /* We can't use gcc_obstack_init to initialize the obstack since
118              print-rtl.c now calls bitmap functions, and bitmap is linked
119              into the gen* functions.  */
120           if (!bitmap_obstack_init)
121             {
122               bitmap_obstack_init = TRUE;
123
124 #if !defined(__GNUC__) || (__GNUC__ < 2)
125 #define __alignof__(type) 0
126 #endif
127
128               obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE,
129                                           __alignof__ (bitmap_element),
130                                           obstack_chunk_alloc,
131                                           obstack_chunk_free);
132             }
133
134           element = XOBNEW (&bitmap_obstack, bitmap_element);
135         }
136     }
137   else
138     {
139       if (bitmap_ggc_free != NULL)
140         {
141           element = bitmap_ggc_free;
142           bitmap_ggc_free = element->next;
143         }
144       else
145         element = GGC_NEW (bitmap_element);
146     }
147
148   memset (element->bits, 0, sizeof (element->bits));
149
150   return element;
151 }
152
153 /* Release any memory allocated by bitmaps.  */
154
155 void
156 bitmap_release_memory (void)
157 {
158   bitmap_free = 0;
159   if (bitmap_obstack_init)
160     {
161       bitmap_obstack_init = FALSE;
162       obstack_free (&bitmap_obstack, NULL);
163     }
164 }
165
166 /* Return nonzero if all bits in an element are zero.  */
167
168 static INLINE int
169 bitmap_element_zerop (bitmap_element *element)
170 {
171 #if BITMAP_ELEMENT_WORDS == 2
172   return (element->bits[0] | element->bits[1]) == 0;
173 #else
174   int i;
175
176   for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
177     if (element->bits[i] != 0)
178       return 0;
179
180   return 1;
181 #endif
182 }
183 \f
184 /* Link the bitmap element into the current bitmap linked list.  */
185
186 static INLINE void
187 bitmap_element_link (bitmap head, bitmap_element *element)
188 {
189   unsigned int indx = element->indx;
190   bitmap_element *ptr;
191
192   /* If this is the first and only element, set it in.  */
193   if (head->first == 0)
194     {
195       element->next = element->prev = 0;
196       head->first = element;
197     }
198
199   /* If this index is less than that of the current element, it goes someplace
200      before the current element.  */
201   else if (indx < head->indx)
202     {
203       for (ptr = head->current;
204            ptr->prev != 0 && ptr->prev->indx > indx;
205            ptr = ptr->prev)
206         ;
207
208       if (ptr->prev)
209         ptr->prev->next = element;
210       else
211         head->first = element;
212
213       element->prev = ptr->prev;
214       element->next = ptr;
215       ptr->prev = element;
216     }
217
218   /* Otherwise, it must go someplace after the current element.  */
219   else
220     {
221       for (ptr = head->current;
222            ptr->next != 0 && ptr->next->indx < indx;
223            ptr = ptr->next)
224         ;
225
226       if (ptr->next)
227         ptr->next->prev = element;
228
229       element->next = ptr->next;
230       element->prev = ptr;
231       ptr->next = element;
232     }
233
234   /* Set up so this is the first element searched.  */
235   head->current = element;
236   head->indx = indx;
237 }
238 \f
239 /* Clear a bitmap by freeing the linked list.  */
240
241 INLINE void
242 bitmap_clear (bitmap head)
243 {
244   bitmap_element *element, *next;
245
246   for (element = head->first; element != 0; element = next)
247     {
248       next = element->next;
249       bitmap_elem_to_freelist (head, element);
250     }
251
252   head->first = head->current = 0;
253 }
254 \f
255 /* Copy a bitmap to another bitmap.  */
256
257 void
258 bitmap_copy (bitmap to, bitmap from)
259 {
260   bitmap_element *from_ptr, *to_ptr = 0;
261 #if BITMAP_ELEMENT_WORDS != 2
262   int i;
263 #endif
264
265   bitmap_clear (to);
266
267   /* Copy elements in forward direction one at a time.  */
268   for (from_ptr = from->first; from_ptr; from_ptr = from_ptr->next)
269     {
270       bitmap_element *to_elt = bitmap_element_allocate (to);
271
272       to_elt->indx = from_ptr->indx;
273
274 #if BITMAP_ELEMENT_WORDS == 2
275       to_elt->bits[0] = from_ptr->bits[0];
276       to_elt->bits[1] = from_ptr->bits[1];
277 #else
278       for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
279         to_elt->bits[i] = from_ptr->bits[i];
280 #endif
281
282       /* Here we have a special case of bitmap_element_link, for the case
283          where we know the links are being entered in sequence.  */
284       if (to_ptr == 0)
285         {
286           to->first = to->current = to_elt;
287           to->indx = from_ptr->indx;
288           to_elt->next = to_elt->prev = 0;
289         }
290       else
291         {
292           to_elt->prev = to_ptr;
293           to_elt->next = 0;
294           to_ptr->next = to_elt;
295         }
296
297       to_ptr = to_elt;
298     }
299 }
300 \f
301 /* Find a bitmap element that would hold a bitmap's bit.
302    Update the `current' field even if we can't find an element that
303    would hold the bitmap's bit to make eventual allocation
304    faster.  */
305
306 static INLINE bitmap_element *
307 bitmap_find_bit (bitmap head, unsigned int bit)
308 {
309   bitmap_element *element;
310   unsigned int indx = bit / BITMAP_ELEMENT_ALL_BITS;
311
312   if (head->current == 0
313       || head->indx == indx)
314     return head->current;
315
316   if (head->indx > indx)
317     for (element = head->current;
318          element->prev != 0 && element->indx > indx;
319          element = element->prev)
320       ;
321
322   else
323     for (element = head->current;
324          element->next != 0 && element->indx < indx;
325          element = element->next)
326       ;
327
328   /* `element' is the nearest to the one we want.  If it's not the one we
329      want, the one we want doesn't exist.  */
330   head->current = element;
331   head->indx = element->indx;
332   if (element != 0 && element->indx != indx)
333     element = 0;
334
335   return element;
336 }
337 \f
338 /* Clear a single bit in a bitmap.  */
339
340 void
341 bitmap_clear_bit (bitmap head, int bit)
342 {
343   bitmap_element *ptr = bitmap_find_bit (head, bit);
344
345   if (ptr != 0)
346     {
347       unsigned bit_num  = bit % BITMAP_WORD_BITS;
348       unsigned word_num = bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS;
349       ptr->bits[word_num] &= ~ (((BITMAP_WORD) 1) << bit_num);
350
351       /* If we cleared the entire word, free up the element.  */
352       if (bitmap_element_zerop (ptr))
353         bitmap_element_free (head, ptr);
354     }
355 }
356
357 /* Set a single bit in a bitmap.  */
358
359 void
360 bitmap_set_bit (bitmap head, int bit)
361 {
362   bitmap_element *ptr = bitmap_find_bit (head, bit);
363   unsigned word_num = bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS;
364   unsigned bit_num  = bit % BITMAP_WORD_BITS;
365   BITMAP_WORD bit_val = ((BITMAP_WORD) 1) << bit_num;
366
367   if (ptr == 0)
368     {
369       ptr = bitmap_element_allocate (head);
370       ptr->indx = bit / BITMAP_ELEMENT_ALL_BITS;
371       ptr->bits[word_num] = bit_val;
372       bitmap_element_link (head, ptr);
373     }
374   else
375     ptr->bits[word_num] |= bit_val;
376 }
377
378 /* Return whether a bit is set within a bitmap.  */
379
380 int
381 bitmap_bit_p (bitmap head, int bit)
382 {
383   bitmap_element *ptr;
384   unsigned bit_num;
385   unsigned word_num;
386
387   ptr = bitmap_find_bit (head, bit);
388   if (ptr == 0)
389     return 0;
390
391   bit_num = bit % BITMAP_WORD_BITS;
392   word_num = bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS;
393
394   return (ptr->bits[word_num] >> bit_num) & 1;
395 }
396 \f
397 /* Return the bit number of the first set bit in the bitmap, or -1
398    if the bitmap is empty.  */
399
400 int
401 bitmap_first_set_bit (bitmap a)
402 {
403   bitmap_element *ptr = a->first;
404   BITMAP_WORD word;
405   unsigned word_num, bit_num;
406
407   if (ptr == NULL)
408     return -1;
409
410 #if BITMAP_ELEMENT_WORDS == 2
411   word_num = 0, word = ptr->bits[0];
412   if (word == 0)
413     word_num = 1, word = ptr->bits[1];
414 #else
415   for (word_num = 0; word_num < BITMAP_ELEMENT_WORDS; ++word_num)
416     if ((word = ptr->bits[word_num]) != 0)
417       goto word_found;
418   gcc_unreachable ();
419  word_found:
420 #endif
421
422   /* Binary search for the first set bit.  */
423   /* ??? It'd be nice to know if ffs or ffsl was available.  */
424
425   bit_num = 0;
426   word = word & -word;
427
428 #if nBITMAP_WORD_BITS > 64
429  #error "Fill out the table."
430 #endif
431 #if nBITMAP_WORD_BITS > 32
432   if ((word & 0xffffffff) == 0)
433     word >>= 32, bit_num += 32;
434 #endif
435   if ((word & 0xffff) == 0)
436     word >>= 16, bit_num += 16;
437   if ((word & 0xff) == 0)
438     word >>= 8, bit_num += 8;
439   if (word & 0xf0)
440     bit_num += 4;
441   if (word & 0xcc)
442     bit_num += 2;
443   if (word & 0xaa)
444     bit_num += 1;
445
446   return (ptr->indx * BITMAP_ELEMENT_ALL_BITS
447           + word_num * BITMAP_WORD_BITS
448           + bit_num);
449 }
450
451 /* Return the bit number of the last set bit in the bitmap, or -1
452    if the bitmap is empty.  */
453
454 int
455 bitmap_last_set_bit (bitmap a)
456 {
457   bitmap_element *ptr = a->first;
458   BITMAP_WORD word;
459   unsigned word_num, bit_num;
460
461   if (ptr == NULL)
462     return -1;
463
464   while (ptr->next != NULL)
465     ptr = ptr->next;
466
467 #if BITMAP_ELEMENT_WORDS == 2
468   word_num = 1, word = ptr->bits[1];
469   if (word == 0)
470     word_num = 0, word = ptr->bits[0];
471 #else
472   for (word_num = BITMAP_ELEMENT_WORDS; word_num-- > 0; )
473     if ((word = ptr->bits[word_num]) != 0)
474       goto word_found;
475   gcc_unreachable ();
476  word_found:
477 #endif
478
479   /* Binary search for the last set bit.  */
480
481   bit_num = 0;
482 #if nBITMAP_WORD_BITS > 64
483  #error "Fill out the table."
484 #endif
485 #if nBITMAP_WORD_BITS > 32
486   if (word & ~(BITMAP_WORD)0xffffffff)
487     word >>= 32, bit_num += 32;
488 #endif
489   if (word & 0xffff0000)
490     word >>= 16, bit_num += 16;
491   if (word & 0xff00)
492     word >>= 8, bit_num += 8;
493   if (word & 0xf0)
494     word >>= 4, bit_num += 4;
495   if (word & 0xc)
496     word >>= 2, bit_num += 2;
497   if (word & 0x2)
498     bit_num += 1;
499
500   return (ptr->indx * BITMAP_ELEMENT_ALL_BITS
501           + word_num * BITMAP_WORD_BITS
502           + bit_num);
503 }
504 \f
505 /* Store in bitmap TO the result of combining bitmap FROM1 and FROM2 using
506    a specific bit manipulation.  Return true if TO changes.  */
507
508 int
509 bitmap_operation (bitmap to, bitmap from1, bitmap from2,
510                   enum bitmap_bits operation)
511 {
512 #define HIGHEST_INDEX (unsigned int) ~0
513
514   bitmap_element *from1_ptr = from1->first;
515   bitmap_element *from2_ptr = from2->first;
516   unsigned int indx1 = (from1_ptr) ? from1_ptr->indx : HIGHEST_INDEX;
517   unsigned int indx2 = (from2_ptr) ? from2_ptr->indx : HIGHEST_INDEX;
518   bitmap_element *to_ptr = to->first;
519   bitmap_element *from1_tmp;
520   bitmap_element *from2_tmp;
521   bitmap_element *to_tmp;
522   unsigned int indx;
523   int changed = 0;
524
525 #if BITMAP_ELEMENT_WORDS == 2
526 #define DOIT(OP)                                        \
527   do {                                                  \
528     BITMAP_WORD t0, t1, f10, f11, f20, f21;             \
529     f10 = from1_tmp->bits[0];                           \
530     f20 = from2_tmp->bits[0];                           \
531     t0 = f10 OP f20;                                    \
532     changed |= (t0 != to_tmp->bits[0]);                 \
533     f11 = from1_tmp->bits[1];                           \
534     f21 = from2_tmp->bits[1];                           \
535     t1 = f11 OP f21;                                    \
536     changed |= (t1 != to_tmp->bits[1]);                 \
537     to_tmp->bits[0] = t0;                               \
538     to_tmp->bits[1] = t1;                               \
539   } while (0)
540 #else
541 #define DOIT(OP)                                        \
542   do {                                                  \
543     BITMAP_WORD t, f1, f2;                              \
544     int i;                                              \
545     for (i = 0; i < BITMAP_ELEMENT_WORDS; ++i)          \
546       {                                                 \
547         f1 = from1_tmp->bits[i];                        \
548         f2 = from2_tmp->bits[i];                        \
549         t = f1 OP f2;                                   \
550         changed |= (t != to_tmp->bits[i]);              \
551         to_tmp->bits[i] = t;                            \
552       }                                                 \
553   } while (0)
554 #endif
555
556   to->first = to->current = 0;
557
558   while (from1_ptr != 0 || from2_ptr != 0)
559     {
560       /* Figure out whether we need to substitute zero elements for
561          missing links.  */
562       if (indx1 == indx2)
563         {
564           indx = indx1;
565           from1_tmp = from1_ptr;
566           from2_tmp = from2_ptr;
567           from1_ptr = from1_ptr->next;
568           indx1 = (from1_ptr) ? from1_ptr->indx : HIGHEST_INDEX;
569           from2_ptr = from2_ptr->next;
570           indx2 = (from2_ptr) ? from2_ptr->indx : HIGHEST_INDEX;
571         }
572       else if (indx1 < indx2)
573         {
574           indx = indx1;
575           from1_tmp = from1_ptr;
576           from2_tmp = &bitmap_zero_bits;
577           from1_ptr = from1_ptr->next;
578           indx1 = (from1_ptr) ? from1_ptr->indx : HIGHEST_INDEX;
579         }
580       else
581         {
582           indx = indx2;
583           from1_tmp = &bitmap_zero_bits;
584           from2_tmp = from2_ptr;
585           from2_ptr = from2_ptr->next;
586           indx2 = (from2_ptr) ? from2_ptr->indx : HIGHEST_INDEX;
587         }
588
589       /* Find the appropriate element from TO.  Begin by discarding
590          elements that we've skipped.  */
591       while (to_ptr && to_ptr->indx < indx)
592         {
593           changed = 1;
594           to_tmp = to_ptr;
595           to_ptr = to_ptr->next;
596           bitmap_elem_to_freelist (to, to_tmp);
597         }
598       if (to_ptr && to_ptr->indx == indx)
599         {
600           to_tmp = to_ptr;
601           to_ptr = to_ptr->next;
602         }
603       else
604         to_tmp = bitmap_element_allocate (to);
605
606       /* Do the operation, and if any bits are set, link it into the
607          linked list.  */
608       switch (operation)
609         {
610         default:
611           gcc_unreachable ();
612
613         case BITMAP_AND:
614           DOIT (&);
615           break;
616
617         case BITMAP_AND_COMPL:
618           DOIT (&~);
619           break;
620
621         case BITMAP_IOR:
622           DOIT (|);
623           break;
624         case BITMAP_IOR_COMPL:
625           DOIT (|~);
626           break;
627         case BITMAP_XOR:
628           DOIT (^);
629           break;
630         }
631
632       if (! bitmap_element_zerop (to_tmp))
633         {
634           to_tmp->indx = indx;
635           bitmap_element_link (to, to_tmp);
636         }
637       else
638         {
639           bitmap_elem_to_freelist (to, to_tmp);
640         }
641     }
642
643   /* If we have elements of TO left over, free the lot.  */
644   if (to_ptr)
645     {
646       changed = 1;
647       for (to_tmp = to_ptr; to_tmp->next ; to_tmp = to_tmp->next)
648         continue;
649       if (to->using_obstack)
650         {
651           to_tmp->next = bitmap_free;
652           bitmap_free = to_ptr;
653         }
654       else
655         {
656           to_tmp->next = bitmap_ggc_free;
657           bitmap_ggc_free = to_ptr;
658         }
659     }
660
661 #undef DOIT
662
663   return changed;
664 }
665
666 /* Return true if two bitmaps are identical.  */
667
668 int
669 bitmap_equal_p (bitmap a, bitmap b)
670 {
671   bitmap_head c;
672   int ret;
673
674   memset (&c, 0, sizeof (c));
675   ret = ! bitmap_operation (&c, a, b, BITMAP_XOR);
676   bitmap_clear (&c);
677
678   return ret;
679 }
680 \f
681 /* Or into bitmap TO bitmap FROM1 and'ed with the complement of
682    bitmap FROM2.  */
683
684 void
685 bitmap_ior_and_compl (bitmap to, bitmap from1, bitmap from2)
686 {
687   bitmap_head tmp;
688
689   tmp.first = tmp.current = 0;
690   tmp.using_obstack = 0;
691
692   bitmap_operation (&tmp, from1, from2, BITMAP_AND_COMPL);
693   bitmap_operation (to, to, &tmp, BITMAP_IOR);
694   bitmap_clear (&tmp);
695 }
696
697 int
698 bitmap_union_of_diff (bitmap dst, bitmap a, bitmap b, bitmap c)
699 {
700   bitmap_head tmp;
701   int changed;
702
703   tmp.first = tmp.current = 0;
704   tmp.using_obstack = 0;
705
706   bitmap_operation (&tmp, b, c, BITMAP_AND_COMPL);
707   changed = bitmap_operation (dst, &tmp, a, BITMAP_IOR);
708   bitmap_clear (&tmp);
709
710   return changed;
711 }
712 \f
713 /* Initialize a bitmap header.  */
714
715 bitmap
716 bitmap_initialize (bitmap head, int using_obstack)
717 {
718   if (head == NULL && ! using_obstack)
719     head = GGC_NEW (struct bitmap_head_def);
720
721   head->first = head->current = 0;
722   head->using_obstack = using_obstack;
723
724   return head;
725 }
726 \f
727 /* Debugging function to print out the contents of a bitmap.  */
728
729 void
730 debug_bitmap_file (FILE *file, bitmap head)
731 {
732   bitmap_element *ptr;
733
734   fprintf (file, "\nfirst = " HOST_PTR_PRINTF
735            " current = " HOST_PTR_PRINTF " indx = %u\n",
736            (void *) head->first, (void *) head->current, head->indx);
737
738   for (ptr = head->first; ptr; ptr = ptr->next)
739     {
740       unsigned int i, j, col = 26;
741
742       fprintf (file, "\t" HOST_PTR_PRINTF " next = " HOST_PTR_PRINTF
743                " prev = " HOST_PTR_PRINTF " indx = %u\n\t\tbits = {",
744                (void*) ptr, (void*) ptr->next, (void*) ptr->prev, ptr->indx);
745
746       for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
747         for (j = 0; j < BITMAP_WORD_BITS; j++)
748           if ((ptr->bits[i] >> j) & 1)
749             {
750               if (col > 70)
751                 {
752                   fprintf (file, "\n\t\t\t");
753                   col = 24;
754                 }
755
756               fprintf (file, " %u", (ptr->indx * BITMAP_ELEMENT_ALL_BITS
757                                      + i * BITMAP_WORD_BITS + j));
758               col += 4;
759             }
760
761       fprintf (file, " }\n");
762     }
763 }
764
765 /* Function to be called from the debugger to print the contents
766    of a bitmap.  */
767
768 void
769 debug_bitmap (bitmap head)
770 {
771   debug_bitmap_file (stdout, head);
772 }
773
774 /* Function to print out the contents of a bitmap.  Unlike debug_bitmap_file,
775    it does not print anything but the bits.  */
776
777 void
778 bitmap_print (FILE *file, bitmap head, const char *prefix, const char *suffix)
779 {
780   const char *comma = "";
781   int i;
782   bitmap_iterator bi;
783
784   fputs (prefix, file);
785   EXECUTE_IF_SET_IN_BITMAP (head, 0, i, bi)
786     {
787       fprintf (file, "%s%d", comma, i);
788       comma = ", ";
789     }
790   fputs (suffix, file);
791 }
792
793 #include "gt-bitmap.h"