[patch] Iterator-style EXECUTE_IF_SET_IN_BITMAP macros

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Sun Sep 26 12:24:00 GMT 2004


Hello,

this patch changes EXECUTE_IF_SET_IN_BITMAP macros to use iterator
style, i.e. instead of writing

EXECUTE_IF_SET_IN_BITMAP (bmp, min, idx,
  {
    whatever;
  });

one would write

bitmap_iterator bi;

EXECUTE_IF_SET_IN_BITMAP (bmp, min, idx, bi)
  {
    whatever;
  }

The advantages are that the code is easier to debug, and that you may
use continue/break statements inside 'whatever' and they will behave
as expected.

As a side bonus it seems that the new implementation of the macros
is more efficient than the old one, resulting in about 2% gain in
compile time (time to compile preprocessed gcc sources decreased from
192 s to 188 s for me).

Bootstrapped & regtested on i686.

Zdenek

	* bitmap.h (EXECUTE_IF_SET_IN_BITMAP, EXECUTE_IF_AND_COMPL_IN_BITMAP,
	EXECUTE_IF_AND_IN_BITMAP): Changed to iterator style.
	(bitmap_iterator): New type.
	(bmp_iter_common_next_1, bmp_iter_single_next_1, bmp_iter_single_init,
	bmp_iter_end_p, bmp_iter_single_next, bmp_iter_and_not_next_1,
	bmp_iter_and_not_init, bmp_iter_and_not_next, bmp_iter_and_next_1,
	bmp_iter_and_init, bmp_iter_and_next): New functions.
	* basic-block.h (EXECUTE_IF_SET_IN_REG_SET,
	EXECUTE_IF_AND_COMPL_IN_REG_SET, EXECUTE_IF_AND_IN_REG_SET): Changed to
	use iterator-style EXECUTE_IF_IN_BITMAP macros.
	* bitmap.c (bitmap_print): Ditto.
	* bt-load.c (clear_btr_from_live_range, add_btr_to_live_range,
	btr_def_live_range): Ditto.
	* cfganal.c (compute_dominance_frontiers_1) Ditto.
	* cgraphunit.c (convert_UIDs_in_bitmap, cgraph_characterize_statics):
	Ditto.
	* ddg.c (build_inter_loop_deps): Ditto.
	* df.c (FOR_EACH_BB_IN_BITMAP, df_bb_reg_info_compute, df_refs_update):
	Ditto.
	* except.c (remove_eh_handler): Ditto.
	* flow.c (reg_set_to_hard_reg_set): Ditto.
	* gcse.c (clear_modify_mem_tables): Ditto.
	* global.c (build_insn_chain): Ditto.
	* ifcvt.c (dead_or_predicable): Ditto.
	* loop-invariant.c (get_inv_cost, set_move_mark, move_invariant_reg):
	Ditto.
	* ra-build.c (livethrough_conflicts_bb, conflicts_between_webs): Ditto.
	* ra-rewrite.c (reloads_to_loads, rewrite_program2,
	detect_web_parts_to_rebuild, delete_useless_defs, actual_spill): Ditto.
	* tree-cfg.c (allocate_ssa_names, tree_duplicate_sese_region,
	tree_purge_all_dead_eh_edges): Ditto.
	* tree-into-ssa.c (compute_global_livein, insert_phi_nodes,
	insert_phi_nodes_for, debug_def_blocks_r, invalidate_name_tags,
	rewrite_ssa_into_ssa): Ditto.
	* tree-outof-ssa.c (find_replaceable_exprs): Ditto.
	* tree-sra.c (scan_function, decide_instantiations, scalarize_parms):
	Ditto.
	* tree-ssa-alias.c (init_alias_info, compute_points_to_and_addr_escape,
	compute_flow_sensitive_aliasing, maybe_create_global_var,
	dump_points_to_info_for): Ditto.
	* tree-ssa-dce.c (EXECUTE_IF_CONTROL_DEPENDENT): Ditto.
	* tree-ssa-dse.c (dse_finalize_block): Ditto.
	* tree-ssa-live.c (live_worklist, calculate_live_on_entry,
	calculate_live_on_exit, build_tree_conflict_graph, dump_live_info):
	Ditto.
	* tree-ssa-loop-ivopts.c (find_induction_variables,
	find_interesting_uses, add_old_ivs_candidates, alloc_use_cost_map,
	determine_use_iv_costs, determine_set_costs, find_best_candidate,
	set_cost_up_to, create_new_ivs, remove_unused_ivs, free_loop_data):
	Ditto.
	* tree-ssa-loop-manip.c (add_exit_phis_var, add_exit_phis): Ditto.
	* tree-ssa-operands.c (get_asm_expr_operands, add_call_clobber_ops,
	add_call_read_ops): Ditto.
	* tree-ssa-pre.c (bitmap_print_value_set, insert_aux): Ditto.

Index: basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.213
diff -c -3 -p -r1.213 basic-block.h
*** basic-block.h	19 Sep 2004 16:04:00 -0000	1.213
--- basic-block.h	25 Sep 2004 22:08:40 -0000
*************** do {									\
*** 84,102 ****
  /* Loop over all registers in REGSET, starting with MIN, setting REGNUM to the
     register number and executing CODE for all registers that are set.  */
  #define EXECUTE_IF_SET_IN_REG_SET(REGSET, MIN, REGNUM, CODE)		\
!   EXECUTE_IF_SET_IN_BITMAP (REGSET, MIN, REGNUM, CODE)
  
  /* Loop over all registers in REGSET1 and REGSET2, starting with MIN, setting
     REGNUM to the register number and executing CODE for all registers that are
     set in the first regset and not set in the second.  */
  #define EXECUTE_IF_AND_COMPL_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, CODE) \
!   EXECUTE_IF_AND_COMPL_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, CODE)
  
  /* Loop over all registers in REGSET1 and REGSET2, starting with MIN, setting
     REGNUM to the register number and executing CODE for all registers that are
     set in both regsets.  */
  #define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, CODE) \
!   EXECUTE_IF_AND_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, CODE)
  
  /* Allocate a register set with oballoc.  */
  #define OBSTACK_ALLOC_REG_SET(OBSTACK) BITMAP_OBSTACK_ALLOC (OBSTACK)
--- 84,126 ----
  /* Loop over all registers in REGSET, starting with MIN, setting REGNUM to the
     register number and executing CODE for all registers that are set.  */
  #define EXECUTE_IF_SET_IN_REG_SET(REGSET, MIN, REGNUM, CODE)		\
!   do									\
!     {									\
!       bitmap_iterator bi;						\
! 									\
!       EXECUTE_IF_SET_IN_BITMAP (REGSET, MIN, REGNUM, bi)		\
! 	{								\
! 	  CODE;								\
!         }								\
!     } while (0)
  
  /* Loop over all registers in REGSET1 and REGSET2, starting with MIN, setting
     REGNUM to the register number and executing CODE for all registers that are
     set in the first regset and not set in the second.  */
  #define EXECUTE_IF_AND_COMPL_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, CODE) \
!   do									\
!     {									\
!       bitmap_iterator bi;						\
! 									\
!       EXECUTE_IF_AND_COMPL_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, bi) \
! 	{								\
! 	  CODE;								\
!         }								\
!     } while (0)
  
  /* Loop over all registers in REGSET1 and REGSET2, starting with MIN, setting
     REGNUM to the register number and executing CODE for all registers that are
     set in both regsets.  */
  #define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, CODE) \
!   do									\
!     {									\
!       bitmap_iterator bi;						\
! 									\
!       EXECUTE_IF_AND_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, bi)	\
! 	{								\
! 	  CODE;								\
!         }								\
!     } while (0)
  
  /* Allocate a register set with oballoc.  */
  #define OBSTACK_ALLOC_REG_SET(OBSTACK) BITMAP_OBSTACK_ALLOC (OBSTACK)
Index: bitmap.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bitmap.c,v
retrieving revision 1.51
diff -c -3 -p -r1.51 bitmap.c
*** bitmap.c	30 Aug 2004 19:13:03 -0000	1.51
--- bitmap.c	25 Sep 2004 22:08:40 -0000
*************** bitmap_print (FILE *file, bitmap head, c
*** 779,791 ****
  {
    const char *comma = "";
    int i;
  
    fputs (prefix, file);
!   EXECUTE_IF_SET_IN_BITMAP (head, 0, i,
! 			    {
! 			      fprintf (file, "%s%d", comma, i);
! 			      comma = ", ";
! 			    });
    fputs (suffix, file);
  }
  
--- 779,792 ----
  {
    const char *comma = "";
    int i;
+   bitmap_iterator bi;
  
    fputs (prefix, file);
!   EXECUTE_IF_SET_IN_BITMAP (head, 0, i, bi)
!     {
!       fprintf (file, "%s%d", comma, i);
!       comma = ", ";
!     }
    fputs (suffix, file);
  }
  
Index: bitmap.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bitmap.h,v
retrieving revision 1.33
diff -c -3 -p -r1.33 bitmap.h
*** bitmap.h	21 Dec 2003 14:08:32 -0000	1.33
--- bitmap.h	25 Sep 2004 22:08:40 -0000
*************** do {						\
*** 162,355 ****
  /* Do any one-time initializations needed for bitmaps.  */
  #define BITMAP_INIT_ONCE()
  
! /* Loop over all bits in BITMAP, starting with MIN, setting BITNUM to the
!    bit number and executing CODE for all bits that are set.  */
  
! #define EXECUTE_IF_SET_IN_BITMAP(BITMAP, MIN, BITNUM, CODE)		\
! do {									\
!   bitmap_element *ptr_ = (BITMAP)->first;				\
!   unsigned int indx_ = (MIN) / BITMAP_ELEMENT_ALL_BITS;			\
!   unsigned bit_num_ = (MIN) % BITMAP_WORD_BITS;				\
!   unsigned word_num_ = (MIN) / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS;	\
! 									\
! 									\
!   /* Find the block the minimum bit is in.  */				\
!   while (ptr_ != 0 && ptr_->indx < indx_)				\
!     ptr_ = ptr_->next;							\
! 									\
!   if (ptr_ != 0 && ptr_->indx != indx_)					\
!     {									\
!       bit_num_ = 0;							\
!       word_num_ = 0;							\
!     }									\
! 									\
!   for (; ptr_ != 0; ptr_ = ptr_->next)					\
!     {									\
!       for (; word_num_ < BITMAP_ELEMENT_WORDS; word_num_++)		\
! 	{								\
! 	  BITMAP_WORD word_ = ptr_->bits[word_num_];			\
! 									\
! 	  if (word_ != 0)						\
! 	    {								\
! 	      for (; bit_num_ < BITMAP_WORD_BITS; bit_num_++)		\
! 		{							\
! 		  BITMAP_WORD mask_ = ((BITMAP_WORD) 1) << bit_num_;	\
! 									\
! 		  if ((word_ & mask_) != 0)				\
! 		    {							\
! 		      word_ &= ~ mask_;					\
! 		      (BITNUM) = (ptr_->indx * BITMAP_ELEMENT_ALL_BITS  \
! 				  + word_num_ * BITMAP_WORD_BITS	\
! 				  + bit_num_);				\
! 		      CODE;						\
! 									\
! 		      if (word_ == 0)					\
! 			break;						\
! 		    }							\
! 		}							\
! 	    }								\
! 									\
! 	  bit_num_ = 0;							\
! 	}								\
! 									\
!       word_num_ = 0;							\
!     }									\
! } while (0)
! 
! /* Loop over all bits in BITMAP1 and BITMAP2, starting with MIN, setting
!    BITNUM to the bit number and executing CODE for all bits that are set in
!    the first bitmap and not set in the second.  */
! 
! #define EXECUTE_IF_AND_COMPL_IN_BITMAP(BITMAP1, BITMAP2, MIN, BITNUM, CODE) \
! do {									\
!   bitmap_element *ptr1_ = (BITMAP1)->first;				\
!   bitmap_element *ptr2_ = (BITMAP2)->first;				\
!   unsigned int indx_ = (MIN) / BITMAP_ELEMENT_ALL_BITS;			\
!   unsigned bit_num_ = (MIN) % BITMAP_WORD_BITS;				\
!   unsigned word_num_ = (MIN) / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS;	\
! 									\
!   /* Find the block the minimum bit is in in the first bitmap.  */	\
!   while (ptr1_ != 0 && ptr1_->indx < indx_)				\
!     ptr1_ = ptr1_->next;						\
! 									\
!   if (ptr1_ != 0 && ptr1_->indx != indx_)				\
!     {									\
!       bit_num_ = 0;							\
!       word_num_ = 0;							\
!     }									\
! 									\
!   for (; ptr1_ != 0 ; ptr1_ = ptr1_->next)				\
!     {									\
!       /* Advance BITMAP2 to the equivalent link, using an all		\
! 	 zero element if an equivalent link doesn't exist.  */		\
!       bitmap_element *tmp2_;						\
! 									\
!       while (ptr2_ != 0 && ptr2_->indx < ptr1_->indx)			\
! 	ptr2_ = ptr2_->next;						\
! 									\
!       tmp2_ = ((ptr2_ != 0 && ptr2_->indx == ptr1_->indx)		\
! 	       ? ptr2_ : &bitmap_zero_bits);				\
! 									\
!       for (; word_num_ < BITMAP_ELEMENT_WORDS; word_num_++)		\
! 	{								\
! 	  BITMAP_WORD word_ = (ptr1_->bits[word_num_]			\
! 			       & ~ tmp2_->bits[word_num_]);		\
! 	  if (word_ != 0)						\
! 	    {								\
! 	      for (; bit_num_ < BITMAP_WORD_BITS; bit_num_++)		\
! 		{							\
! 		  BITMAP_WORD mask_ = ((BITMAP_WORD) 1) << bit_num_;	\
! 									\
! 		  if ((word_ & mask_) != 0)				\
! 		    {							\
! 		      word_ &= ~ mask_;					\
! 		      (BITNUM) = (ptr1_->indx * BITMAP_ELEMENT_ALL_BITS \
! 				  + word_num_ * BITMAP_WORD_BITS	\
! 				  + bit_num_);				\
! 									\
! 		      CODE;						\
! 		      if (word_ == 0)					\
! 			break;						\
! 		    }							\
! 		}							\
! 	    }								\
! 									\
! 	  bit_num_ = 0;							\
! 	}								\
! 									\
!       word_num_ = 0;							\
!     }									\
! } while (0)
! 
! /* Loop over all bits in BITMAP1 and BITMAP2, starting with MIN, setting
!    BITNUM to the bit number and executing CODE for all bits that are set in
!    the both bitmaps.  */
! 
! #define EXECUTE_IF_AND_IN_BITMAP(BITMAP1, BITMAP2, MIN, BITNUM, CODE)	\
! do {									\
!   bitmap_element *ptr1_ = (BITMAP1)->first;				\
!   bitmap_element *ptr2_ = (BITMAP2)->first;				\
!   unsigned int indx_ = (MIN) / BITMAP_ELEMENT_ALL_BITS;			\
!   unsigned bit_num_ = (MIN) % BITMAP_WORD_BITS;				\
!   unsigned word_num_ = (MIN) / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS;	\
! 									\
!   /* Find the block the minimum bit is in in the first bitmap.  */	\
!   while (ptr1_ != 0 && ptr1_->indx < indx_)				\
!     ptr1_ = ptr1_->next;						\
! 									\
!   if (ptr1_ != 0 && ptr1_->indx != indx_)				\
!     {									\
!       bit_num_ = 0;							\
!       word_num_ = 0;							\
!     }									\
! 									\
!   for (; ptr1_ != 0 ; ptr1_ = ptr1_->next)				\
!     {									\
!       /* Advance BITMAP2 to the equivalent link.  */			\
!       while (ptr2_ != 0 && ptr2_->indx < ptr1_->indx)			\
! 	ptr2_ = ptr2_->next;						\
! 									\
!       if (ptr2_ == 0)							\
! 	{								\
! 	  /* If there are no more elements in BITMAP2, exit loop now.  */ \
! 	  ptr1_ = (bitmap_element *)0;					\
! 	  break;							\
! 	}								\
!       else if (ptr2_->indx > ptr1_->indx)				\
! 	{								\
! 	  bit_num_ = word_num_ = 0;					\
! 	  continue;							\
! 	}								\
! 									\
!       for (; word_num_ < BITMAP_ELEMENT_WORDS; word_num_++)		\
! 	{								\
! 	  BITMAP_WORD word_ = (ptr1_->bits[word_num_]			\
! 			       & ptr2_->bits[word_num_]);		\
! 	  if (word_ != 0)						\
! 	    {								\
! 	      for (; bit_num_ < BITMAP_WORD_BITS; bit_num_++)		\
! 		{							\
! 		  BITMAP_WORD mask_ = ((BITMAP_WORD) 1) << bit_num_;	\
! 									\
! 		  if ((word_ & mask_) != 0)				\
! 		    {							\
! 		      word_ &= ~ mask_;					\
! 		      (BITNUM) = (ptr1_->indx * BITMAP_ELEMENT_ALL_BITS \
! 				  + word_num_ * BITMAP_WORD_BITS	\
! 				  + bit_num_);				\
! 									\
! 		      CODE;						\
! 		      if (word_ == 0)					\
! 			break;						\
! 		    }							\
! 		}							\
! 	    }								\
! 									\
! 	  bit_num_ = 0;							\
! 	}								\
! 									\
!       word_num_ = 0;							\
!     }									\
! } while (0)
  
  #endif /* GCC_BITMAP_H */
--- 162,586 ----
  /* Do any one-time initializations needed for bitmaps.  */
  #define BITMAP_INIT_ONCE()
  
! /* Iterator for bitmaps.  */
  
! typedef struct
! {
!   /* Actual elements in the bitmaps.  */
!   bitmap_element *ptr1, *ptr2;
! 
!   /* Position of an actual word in the elements.  */
!   unsigned word;
! 
!   /* Position of a bit corresponding to the start of word.  */
!   unsigned word_bit;
! 
!   /* Position of the actual bit.  */
!   unsigned bit;
! 
!   /* Contents of the actually processed word.  When finding next bit
!      it is shifted right, so that the actual bit is always the least
!      significant bit of ACTUAL.  */
!   BITMAP_WORD actual;
! } bitmap_iterator;
! 
! /* Moves the iterator BI to the first set bit on or after the current
!    position in bitmap and returns the bit if available.  The bit is
!    found in ACTUAL field only.  */
! 
! static inline unsigned
! bmp_iter_common_next_1 (bitmap_iterator *bi)
! {
!   while (!(bi->actual & 1))
!     {
!       bi->actual >>= 1;
!       bi->bit++;
!     }
! 
!   return bi->bit;
! }
! 
! /* Moves the iterator BI to the first set bit on or after the current
!    position in bitmap and returns the bit if available.  */
! 
! static inline unsigned
! bmp_iter_single_next_1 (bitmap_iterator *bi)
! {
!   if (bi->actual)
!     return bmp_iter_common_next_1 (bi);
! 
!   bi->word++;
!   bi->word_bit += BITMAP_WORD_BITS;
! 
!   while (1)
!     {
!       for (;
! 	   bi->word < BITMAP_ELEMENT_WORDS;
! 	   bi->word++, bi->word_bit += BITMAP_WORD_BITS)
! 	{
! 	  bi->actual = bi->ptr1->bits[bi->word];
! 	  if (bi->actual)
! 	    {
! 	      bi->bit = bi->word_bit;
! 	      return bmp_iter_common_next_1 (bi);
! 	    }
! 	}
! 
!       bi->ptr1 = bi->ptr1->next;
!       if (!bi->ptr1)
! 	return 0;
! 
!       bi->word = 0;
!       bi->word_bit = bi->ptr1->indx * BITMAP_ELEMENT_ALL_BITS;
!     }
! }
! 
! /* Initializes a bitmap iterator BI for looping over bits of bitmap
!    BMP, starting with bit MIN.  Returns the first bit of BMP greater
!    or equal to MIN if there is any.  */
! 
! static inline unsigned
! bmp_iter_single_init (bitmap_iterator *bi, bitmap bmp, unsigned min)
! {
!   unsigned indx = min / BITMAP_ELEMENT_ALL_BITS;
! 
!   for (bi->ptr1 = bmp->first;
!        bi->ptr1 && bi->ptr1->indx < indx;
!        bi->ptr1 = bi->ptr1->next)
!     continue;
! 
!   if (!bi->ptr1)
!     {
!       /* To avoid warnings.  */
!       bi->word = 0;
!       bi->bit = 0;
!       bi->word_bit = 0;
!       bi->actual = 0;
!       bi->ptr2 = NULL;
!       return 0;
!     }
! 
!   if (bi->ptr1->indx == indx)
!     {
!       unsigned bit_in_elt = min - BITMAP_ELEMENT_ALL_BITS * indx;
!       unsigned word_in_elt = bit_in_elt / BITMAP_WORD_BITS;
!       unsigned bit_in_word = bit_in_elt % BITMAP_WORD_BITS;
! 
!       bi->word = word_in_elt;
!       bi->word_bit = min - bit_in_word;
!       bi->bit = min;
!       bi->actual = bi->ptr1->bits[word_in_elt] >> bit_in_elt;
!     }
!   else
!     {
!       bi->word = 0;
!       bi->bit = bi->ptr1->indx * BITMAP_ELEMENT_ALL_BITS;
!       bi->word_bit = bi->bit;
!       bi->actual = bi->ptr1->bits[0];
!     }
! 
!   return bmp_iter_single_next_1 (bi);
! }
! 
! /* Returns true if all elements of the bitmap refered to by iterator BI
!    were processed.  */
! 
! static inline bool
! bmp_iter_end_p (bitmap_iterator bi)
! {
!   return bi.ptr1 == NULL;
! }
! 
! /* Moves the iterator BI to the next bit of bitmap and returns the bit
!    if available.  */
! 
! static inline unsigned
! bmp_iter_single_next (bitmap_iterator *bi)
! {
!   bi->bit++;
!   bi->actual >>= 1;
!   return bmp_iter_single_next_1 (bi);
! }
! 
! /* Loop over all bits in BITMAP, starting with MIN and setting BITNUM to
!    the bit number.  ITER is a bitmap iterator.  */
! 
! #define EXECUTE_IF_SET_IN_BITMAP(BITMAP, MIN, BITNUM, ITER)		\
!   for ((BITNUM) = bmp_iter_single_init (&(ITER), (BITMAP), (MIN));	\
!        !bmp_iter_end_p (ITER);					\
!        (BITNUM) = bmp_iter_single_next (&(ITER)))
! 
! /* Moves the iterator BI to the first set bit on or after the current
!    position in difference of bitmaps and returns the bit if available.  */
! 
! static inline unsigned
! bmp_iter_and_not_next_1 (bitmap_iterator *bi)
! {
!   if (bi->actual)
!     return bmp_iter_common_next_1 (bi);
! 
!   bi->word++;
!   bi->word_bit += BITMAP_WORD_BITS;
! 
!   while (1)
!     {
!       bitmap_element *snd;
! 
!       if (bi->ptr2 && bi->ptr2->indx == bi->ptr1->indx)
! 	snd = bi->ptr2;
!       else
! 	snd = &bitmap_zero_bits;
! 
!       for (;
! 	   bi->word < BITMAP_ELEMENT_WORDS;
! 	   bi->word++, bi->word_bit += BITMAP_WORD_BITS)
! 	{
! 	  bi->actual = (bi->ptr1->bits[bi->word]
! 			& ~snd->bits[bi->word]);
! 	  if (bi->actual)
! 	    {
! 	      bi->bit = bi->word_bit;
! 	      return bmp_iter_common_next_1 (bi);
! 	    }
! 	}
! 
!       bi->ptr1 = bi->ptr1->next;
!       if (!bi->ptr1)
! 	return 0;
! 
!       while (bi->ptr2
! 	     && bi->ptr2->indx < bi->ptr1->indx)
! 	bi->ptr2 = bi->ptr2->next;
! 
!       bi->word = 0;
!       bi->word_bit = bi->ptr1->indx * BITMAP_ELEMENT_ALL_BITS;
!     }
! }
! 
! /* Initializes a bitmap iterator BI for looping over bits of bitmap
!    BMP1 &~ BMP2, starting with bit MIN.  Returns the first bit of
!    BMP1 &~ BMP2 greater or equal to MIN if there is any.  */
! 
! static inline unsigned
! bmp_iter_and_not_init (bitmap_iterator *bi, bitmap bmp1, bitmap bmp2,
! 		       unsigned min)
! {
!   unsigned indx = min / BITMAP_ELEMENT_ALL_BITS;
! 
!   for (bi->ptr1 = bmp1->first;
!        bi->ptr1 && bi->ptr1->indx < indx;
!        bi->ptr1 = bi->ptr1->next)
!     continue;
! 
!   if (!bi->ptr1)
!     {
!       /* To avoid warnings.  */
!       bi->word = 0;
!       bi->bit = 0;
!       bi->word_bit = 0;
!       bi->actual = 0;
!       bi->ptr2 = NULL;
!       return 0;
!     }
! 
!   for (bi->ptr2 = bmp2->first;
!        bi->ptr2 && bi->ptr2->indx < bi->ptr1->indx;
!        bi->ptr2 = bi->ptr2->next)
!     continue;
! 
!   if (bi->ptr1->indx == indx)
!     {
!       unsigned bit_in_elt = min - BITMAP_ELEMENT_ALL_BITS * indx;
!       unsigned word_in_elt = bit_in_elt / BITMAP_WORD_BITS;
!       unsigned bit_in_word = bit_in_elt % BITMAP_WORD_BITS;
! 
!       bi->word = word_in_elt;
!       bi->word_bit = min - bit_in_word;
!       bi->bit = min;
! 
!       if (bi->ptr2 && bi->ptr2->indx == indx)
! 	bi->actual = (bi->ptr1->bits[word_in_elt]
! 		      & ~bi->ptr2->bits[word_in_elt]) >> bit_in_elt;
!       else
! 	bi->actual = bi->ptr1->bits[word_in_elt] >> bit_in_elt;
!     }
!   else
!     {
!       bi->word = 0;
!       bi->bit = bi->ptr1->indx * BITMAP_ELEMENT_ALL_BITS;
!       bi->word_bit = bi->bit;
! 
!       if (bi->ptr2 && bi->ptr2->indx == bi->ptr1->indx)
! 	bi->actual = (bi->ptr1->bits[0] & ~bi->ptr2->bits[0]);
!       else
! 	bi->actual = bi->ptr1->bits[0];
!     }
! 
!   return bmp_iter_and_not_next_1 (bi);
! }
! 
! /* Moves the iterator BI to the next bit of difference of bitmaps and returns
!    the bit if available.  */
! 
! static inline unsigned
! bmp_iter_and_not_next (bitmap_iterator *bi)
! {
!   bi->bit++;
!   bi->actual >>= 1;
!   return bmp_iter_and_not_next_1 (bi);
! }
! 
! /* Loop over all bits in BMP1 and BMP2, starting with MIN, setting
!    BITNUM to the bit number for all bits that are set in the first bitmap
!    and not set in the second.  ITER is a bitmap iterator.  */
! 
! #define EXECUTE_IF_AND_COMPL_IN_BITMAP(BMP1, BMP2, MIN, BITNUM, ITER)	\
!   for ((BITNUM) = bmp_iter_and_not_init (&(ITER), (BMP1), (BMP2), (MIN)); \
!        !bmp_iter_end_p (ITER);						\
!        (BITNUM) = bmp_iter_and_not_next (&(ITER)))
! 
! /* Moves the iterator BI to the first set bit on or after the current
!    position in intersection of bitmaps and returns the bit if available.  */
! 
! static inline unsigned
! bmp_iter_and_next_1 (bitmap_iterator *bi)
! {
!   if (bi->actual)
!     return bmp_iter_common_next_1 (bi);
! 
!   bi->word++;
!   bi->word_bit += BITMAP_WORD_BITS;
! 
!   while (1)
!     {
!       for (;
! 	   bi->word < BITMAP_ELEMENT_WORDS;
! 	   bi->word++, bi->word_bit += BITMAP_WORD_BITS)
! 	{
! 	  bi->actual = (bi->ptr1->bits[bi->word]
! 			& bi->ptr2->bits[bi->word]);
! 	  if (bi->actual)
! 	    {
! 	      bi->bit = bi->word_bit;
! 	      return bmp_iter_common_next_1 (bi);
! 	    }
! 	}
! 
!       do
! 	{
! 	  bi->ptr1 = bi->ptr1->next;
! 	  if (!bi->ptr1)
! 	    return 0;
! 
! 	  while (bi->ptr2->indx < bi->ptr1->indx)
! 	    {
! 	      bi->ptr2 = bi->ptr2->next;
! 	      if (!bi->ptr2)
! 		{
! 		  bi->ptr1 = NULL;
! 		  return 0;
! 		}
! 	    }
! 	}
!       while (bi->ptr1->indx != bi->ptr2->indx);
! 
!       bi->word = 0;
!       bi->word_bit = bi->ptr1->indx * BITMAP_ELEMENT_ALL_BITS;
!     }
! }
! 
! /* Initializes a bitmap iterator BI for looping over bits of bitmap
!    BMP1 & BMP2, starting with bit MIN.  Returns the first bit of
!    BMP1 & BMP2 greater or equal to MIN if there is any.  */
! 
! static inline unsigned
! bmp_iter_and_init (bitmap_iterator *bi, bitmap bmp1, bitmap bmp2,
! 		       unsigned min)
! {
!   unsigned indx = min / BITMAP_ELEMENT_ALL_BITS;
! 
!   for (bi->ptr1 = bmp1->first;
!        bi->ptr1 && bi->ptr1->indx < indx;
!        bi->ptr1 = bi->ptr1->next)
!     continue;
! 
!   if (!bi->ptr1)
!     goto empty;
! 
!   bi->ptr2 = bmp2->first;
!   if (!bi->ptr2)
!     goto empty;
! 
!   while (1)
!     {
!       while (bi->ptr2->indx < bi->ptr1->indx)
! 	{
! 	  bi->ptr2 = bi->ptr2->next;
! 	  if (!bi->ptr2)
! 	    goto empty;
! 	}
! 
!       if (bi->ptr1->indx == bi->ptr2->indx)
! 	break;
! 
!       bi->ptr1 = bi->ptr1->next;
!       if (!bi->ptr1)
! 	goto empty;
!     }
! 
!   if (bi->ptr1->indx == indx)
!     {
!       unsigned bit_in_elt = min - BITMAP_ELEMENT_ALL_BITS * indx;
!       unsigned word_in_elt = bit_in_elt / BITMAP_WORD_BITS;
!       unsigned bit_in_word = bit_in_elt % BITMAP_WORD_BITS;
! 
!       bi->word = word_in_elt;
!       bi->word_bit = min - bit_in_word;
!       bi->bit = min;
! 
!       bi->actual = (bi->ptr1->bits[word_in_elt]
! 		    & bi->ptr2->bits[word_in_elt]) >> bit_in_elt;
!     }
!   else
!     {
!       bi->word = 0;
!       bi->bit = bi->ptr1->indx * BITMAP_ELEMENT_ALL_BITS;
!       bi->word_bit = bi->bit;
! 
!       bi->actual = (bi->ptr1->bits[0] & bi->ptr2->bits[0]);
!     }
! 
!   return bmp_iter_and_next_1 (bi);
! 
! empty:
!   /* To avoid warnings.  */
!   bi->word = 0;
!   bi->bit = 0;
!   bi->word_bit = 0;
!   bi->actual = 0;
!   bi->ptr1 = NULL;
!   bi->ptr2 = NULL;
!   return 0;
! }
! 
! /* Moves the iterator BI to the next bit of intersection of bitmaps and returns
!    the bit if available.  */
! 
! static inline unsigned
! bmp_iter_and_next (bitmap_iterator *bi)
! {
!   bi->bit++;
!   bi->actual >>= 1;
!   return bmp_iter_and_next_1 (bi);
! }
! 
! /* Loop over all bits in BMP1 and BMP2, starting with MIN, setting
!    BITNUM to the bit number for all bits that are set in both bitmaps.
!    ITER is a bitmap iterator.  */
! 
! #define EXECUTE_IF_AND_IN_BITMAP(BMP1, BMP2, MIN, BITNUM, ITER)		\
!   for ((BITNUM) = bmp_iter_and_init (&(ITER), (BMP1), (BMP2), (MIN));	\
!        !bmp_iter_end_p (ITER);						\
!        (BITNUM) = bmp_iter_and_next (&(ITER)))
  
  #endif /* GCC_BITMAP_H */
Index: bt-load.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bt-load.c,v
retrieving revision 2.24
diff -c -3 -p -r2.24 bt-load.c
*** bt-load.c	30 Aug 2004 19:13:03 -0000	2.24
--- bt-load.c	25 Sep 2004 22:08:40 -0000
*************** static void
*** 822,841 ****
  clear_btr_from_live_range (btr_def def)
  {
    int bb;
  
!   EXECUTE_IF_SET_IN_BITMAP
!     (def->live_range, 0, bb,
!      {
!        if ((!def->other_btr_uses_before_def
! 	     && !def->other_btr_uses_after_use)
! 	   || !block_at_edge_of_live_range_p (bb, def))
! 	 {
! 	   CLEAR_HARD_REG_BIT (btrs_live[bb], def->btr);
! 	   CLEAR_HARD_REG_BIT (btrs_live_at_end[bb], def->btr);
! 	   if (dump_file)
! 	     dump_btrs_live (bb);
! 	 }
!      });
  }
  
  
--- 822,841 ----
  clear_btr_from_live_range (btr_def def)
  {
    int bb;
+   bitmap_iterator bi;
  
!   EXECUTE_IF_SET_IN_BITMAP (def->live_range, 0, bb, bi)
!     {
!       if ((!def->other_btr_uses_before_def
! 	   && !def->other_btr_uses_after_use)
! 	  || !block_at_edge_of_live_range_p (bb, def))
! 	{
! 	  CLEAR_HARD_REG_BIT (btrs_live[bb], def->btr);
! 	  CLEAR_HARD_REG_BIT (btrs_live_at_end[bb], def->btr);
! 	  if (dump_file)
! 	    dump_btrs_live (bb);
! 	}
!     }
  }
  
  
*************** static void
*** 846,859 ****
  add_btr_to_live_range (btr_def def)
  {
    int bb;
!   EXECUTE_IF_SET_IN_BITMAP
!     (def->live_range, 0, bb,
!      {
!        SET_HARD_REG_BIT (btrs_live[bb], def->btr);
!        SET_HARD_REG_BIT (btrs_live_at_end[bb], def->btr);
!        if (dump_file)
! 	 dump_btrs_live (bb);
!      });
  }
  
  /* Update a live range to contain the basic block NEW_BLOCK, and all
--- 846,860 ----
  add_btr_to_live_range (btr_def def)
  {
    int bb;
!   bitmap_iterator bi;
! 
!   EXECUTE_IF_SET_IN_BITMAP (def->live_range, 0, bb, bi)
!     {
!       SET_HARD_REG_BIT (btrs_live[bb], def->btr);
!       SET_HARD_REG_BIT (btrs_live_at_end[bb], def->btr);
!       if (dump_file)
! 	dump_btrs_live (bb);
!     }
  }
  
  /* Update a live range to contain the basic block NEW_BLOCK, and all
*************** btr_def_live_range (btr_def def, HARD_RE
*** 990,1011 ****
        */
        int bb;
        int def_bb = def->bb->index;
  
        CLEAR_HARD_REG_SET (*btrs_live_in_range);
        if (flag_btr_bb_exclusive)
! 	EXECUTE_IF_SET_IN_BITMAP
! 	  (def->live_range, 0, bb,
! 	   {
! 	     IOR_HARD_REG_SET (*btrs_live_in_range, btrs_live[bb]);
! 	   });
        else
! 	EXECUTE_IF_SET_IN_BITMAP
! 	  (def->live_range, 0, bb,
! 	   {
! 	     IOR_HARD_REG_SET (*btrs_live_in_range,
! 			       (def_bb == bb
! 				? btrs_live_at_end : btrs_live) [bb]);
! 	   });
      }
    if (!def->other_btr_uses_before_def &&
        !def->other_btr_uses_after_use)
--- 991,1015 ----
        */
        int bb;
        int def_bb = def->bb->index;
+       bitmap_iterator bi;
  
        CLEAR_HARD_REG_SET (*btrs_live_in_range);
        if (flag_btr_bb_exclusive)
! 	{
! 	  EXECUTE_IF_SET_IN_BITMAP (def->live_range, 0, bb, bi)
! 	    {
! 	      IOR_HARD_REG_SET (*btrs_live_in_range, btrs_live[bb]);
! 	    }
! 	}
        else
! 	{
! 	  EXECUTE_IF_SET_IN_BITMAP (def->live_range, 0, bb, bi)
! 	    {
! 	      IOR_HARD_REG_SET (*btrs_live_in_range,
! 				(def_bb == bb
! 				 ? btrs_live_at_end : btrs_live) [bb]);
! 	    }
! 	}
      }
    if (!def->other_btr_uses_before_def &&
        !def->other_btr_uses_after_use)
Index: cfganal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfganal.c,v
retrieving revision 1.48
diff -c -3 -p -r1.48 cfganal.c
*** cfganal.c	7 Sep 2004 15:46:45 -0000	1.48
--- cfganal.c	25 Sep 2004 22:08:40 -0000
*************** compute_dominance_frontiers_1 (bitmap *f
*** 1086,1097 ****
         c = next_dom_son (CDI_DOMINATORS, c))
      {
        int x;
  
!       EXECUTE_IF_SET_IN_BITMAP (frontiers[c->index], 0, x,
  	{
  	  if (get_immediate_dominator (CDI_DOMINATORS, BASIC_BLOCK (x)) != bb)
  	    bitmap_set_bit (frontiers[bb->index], x);
! 	});
      }
  }
  
--- 1086,1098 ----
         c = next_dom_son (CDI_DOMINATORS, c))
      {
        int x;
+       bitmap_iterator bi;
  
!       EXECUTE_IF_SET_IN_BITMAP (frontiers[c->index], 0, x, bi)
  	{
  	  if (get_immediate_dominator (CDI_DOMINATORS, BASIC_BLOCK (x)) != bb)
  	    bitmap_set_bit (frontiers[bb->index], x);
! 	}
      }
  }
  
Index: cgraphunit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.84
diff -c -3 -p -r1.84 cgraphunit.c
*** cgraphunit.c	20 Sep 2004 20:38:16 -0000	1.84
--- cgraphunit.c	25 Sep 2004 22:08:40 -0000
*************** static void 
*** 352,369 ****
  convert_UIDs_in_bitmap (bitmap in_ann, bitmap in_decl) 
  {
    int index;
!   EXECUTE_IF_SET_IN_BITMAP(in_decl, 0, index,
!       {
! 	splay_tree_node n = 
! 	  splay_tree_lookup (static_vars_to_consider_by_uid, index);
! 	if (n != NULL) 
! 	  {
! 	    tree t = (tree)n->value;
! 	    var_ann_t va = var_ann (t);
! 	    if (va) 
! 	      bitmap_set_bit(in_ann, va->uid);
! 	  }
!       });
  }
  
  /* FIXME -- PROFILE-RESTRUCTURE: Delete all stmts initing *_decl_uid
--- 352,371 ----
  convert_UIDs_in_bitmap (bitmap in_ann, bitmap in_decl) 
  {
    int index;
!   bitmap_iterator bi;
! 
!   EXECUTE_IF_SET_IN_BITMAP(in_decl, 0, index, bi)
!     {
!       splay_tree_node n = 
! 	      splay_tree_lookup (static_vars_to_consider_by_uid, index);
!       if (n != NULL) 
! 	{
! 	  tree t = (tree)n->value;
! 	  var_ann_t va = var_ann (t);
! 	  if (va) 
! 	    bitmap_set_bit(in_ann, va->uid);
! 	}
!     }
  }
  
  /* FIXME -- PROFILE-RESTRUCTURE: Delete all stmts initing *_decl_uid
*************** cgraph_characterize_statics (void)
*** 2456,2463 ****
       (i.e. have there address taken).  */
    {
      int index;
!     EXECUTE_IF_SET_IN_BITMAP (module_statics_escape,
! 			      0, index, clear_static_vars_maps (index));
      bitmap_operation (all_module_statics, all_module_statics,
  		      module_statics_escape, BITMAP_AND_COMPL);
  
--- 2458,2469 ----
       (i.e. have there address taken).  */
    {
      int index;
!     bitmap_iterator bi;
! 
!     EXECUTE_IF_SET_IN_BITMAP (module_statics_escape, 0, index, bi)
!       {
! 	clear_static_vars_maps (index);
!       }
      bitmap_operation (all_module_statics, all_module_statics,
  		      module_statics_escape, BITMAP_AND_COMPL);
  
*************** cgraph_characterize_statics (void)
*** 2484,2489 ****
--- 2490,2497 ----
  	{
  	  int index;
  	  local_static_vars_info_t l;
+ 	  bitmap_iterator bi;
+ 
  	  node = order[i];
  	  l = node->static_vars_info->local;
  	  fprintf (cgraph_dump_file, 
*************** cgraph_characterize_statics (void)
*** 2491,2504 ****
  		   cgraph_node_name (node), node->uid);
  	  fprintf (cgraph_dump_file, "\n  locals read: ");
  	  EXECUTE_IF_SET_IN_BITMAP (l->statics_read_by_decl_uid,
! 				    0, index,
! 				    fprintf (cgraph_dump_file, "%s ",
! 					     cgraph_get_static_name_by_uid (index)));
  	  fprintf (cgraph_dump_file, "\n  locals written: ");
  	  EXECUTE_IF_SET_IN_BITMAP (l->statics_written_by_decl_uid,
! 				    0, index,
! 				    fprintf(cgraph_dump_file, "%s ",
! 					   cgraph_get_static_name_by_uid (index)));
  	}
      }
  
--- 2499,2516 ----
  		   cgraph_node_name (node), node->uid);
  	  fprintf (cgraph_dump_file, "\n  locals read: ");
  	  EXECUTE_IF_SET_IN_BITMAP (l->statics_read_by_decl_uid,
! 				    0, index, bi)
! 	    {
! 	      fprintf (cgraph_dump_file, "%s ",
! 		       cgraph_get_static_name_by_uid (index));
! 	    }
  	  fprintf (cgraph_dump_file, "\n  locals written: ");
  	  EXECUTE_IF_SET_IN_BITMAP (l->statics_written_by_decl_uid,
! 				    0, index, bi)
! 	    {
! 	      fprintf(cgraph_dump_file, "%s ",
! 		      cgraph_get_static_name_by_uid (index));
! 	    }
  	}
      }
  
*************** cgraph_characterize_statics (void)
*** 2597,2602 ****
--- 2609,2616 ----
  	  static_vars_info_t node_info;
  	  global_static_vars_info_t node_g;
  	  int index;
+ 	  bitmap_iterator bi;
+ 
  	  node = order[i];
  	  node_info = node->static_vars_info;
  	  node_g = node_info->global;
*************** cgraph_characterize_statics (void)
*** 2612,2625 ****
  	    }
  	  fprintf (cgraph_dump_file, "\n  globals read: ");
  	  EXECUTE_IF_SET_IN_BITMAP (node_g->statics_read_by_decl_uid,
! 				    0, index,
! 				    fprintf (cgraph_dump_file, "%s ",
! 					     cgraph_get_static_name_by_uid (index)));
  	  fprintf (cgraph_dump_file, "\n  globals written: ");
  	  EXECUTE_IF_SET_IN_BITMAP (node_g->statics_written_by_decl_uid,
! 				    0, index,
! 				    fprintf (cgraph_dump_file, "%s ",
! 					     cgraph_get_static_name_by_uid (index)));
  	}
      }
  
--- 2626,2643 ----
  	    }
  	  fprintf (cgraph_dump_file, "\n  globals read: ");
  	  EXECUTE_IF_SET_IN_BITMAP (node_g->statics_read_by_decl_uid,
! 				    0, index, bi)
! 	    {
! 	      fprintf (cgraph_dump_file, "%s ",
! 		       cgraph_get_static_name_by_uid (index));
! 	    }
  	  fprintf (cgraph_dump_file, "\n  globals written: ");
  	  EXECUTE_IF_SET_IN_BITMAP (node_g->statics_written_by_decl_uid,
! 				    0, index, bi)
! 	    {
! 	      fprintf (cgraph_dump_file, "%s ",
! 		       cgraph_get_static_name_by_uid (index));
! 	    }
  	}
      }
  
Index: ddg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ddg.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 ddg.c
*** ddg.c	17 Sep 2004 09:14:06 -0000	1.8
--- ddg.c	25 Sep 2004 22:08:40 -0000
*************** build_inter_loop_deps (ddg_ptr g, struct
*** 313,340 ****
  {
    int rd_num, u_num;
    struct bb_info *bb_info;
  
    bb_info = DF_BB_INFO (df, g->bb);
  
    /* Find inter-loop output and true deps by connecting downward exposed defs
       to the first def of the BB and to upwards exposed uses.  */
!   EXECUTE_IF_SET_IN_BITMAP (bb_info->rd_gen, 0, rd_num,
      {
        struct ref *rd = df->defs[rd_num];
  
        add_deps_for_def (g, df, rd);
!     });
  
    /* Find inter-loop anti deps.  We are interested in uses of the block that
       appear below all defs; this implies that these uses are killed.  */
!   EXECUTE_IF_SET_IN_BITMAP (bb_info->ru_kill, 0, u_num,
      {
        struct ref *use = df->uses[u_num];
  
        /* We are interested in uses of this BB.  */
        if (BLOCK_FOR_INSN (use->insn) == g->bb)
        	add_deps_for_use (g, df,use);
!     });
  }
  
  /* Given two nodes, analyze their RTL insns and add inter-loop mem deps
--- 313,341 ----
  {
    int rd_num, u_num;
    struct bb_info *bb_info;
+   bitmap_iterator bi;
  
    bb_info = DF_BB_INFO (df, g->bb);
  
    /* Find inter-loop output and true deps by connecting downward exposed defs
       to the first def of the BB and to upwards exposed uses.  */
!   EXECUTE_IF_SET_IN_BITMAP (bb_info->rd_gen, 0, rd_num, bi)
      {
        struct ref *rd = df->defs[rd_num];
  
        add_deps_for_def (g, df, rd);
!     }
  
    /* Find inter-loop anti deps.  We are interested in uses of the block that
       appear below all defs; this implies that these uses are killed.  */
!   EXECUTE_IF_SET_IN_BITMAP (bb_info->ru_kill, 0, u_num, bi)
      {
        struct ref *use = df->uses[u_num];
  
        /* We are interested in uses of this BB.  */
        if (BLOCK_FOR_INSN (use->insn) == g->bb)
        	add_deps_for_use (g, df,use);
!     }
  }
  
  /* Given two nodes, analyze their RTL insns and add inter-loop mem deps
Index: df.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.c,v
retrieving revision 1.71
diff -c -3 -p -r1.71 df.c
*** df.c	8 Sep 2004 07:47:44 -0000	1.71
--- df.c	25 Sep 2004 22:08:41 -0000
*************** and again mark them read/write.
*** 192,199 ****
    do							\
      {							\
        unsigned int node_;				\
!       EXECUTE_IF_SET_IN_BITMAP (BITMAP, MIN, node_,	\
!       {(BB) = BASIC_BLOCK (node_); CODE;});		\
      }							\
    while (0)
  
--- 192,203 ----
    do							\
      {							\
        unsigned int node_;				\
!       bitmap_iterator bi;				\
!       EXECUTE_IF_SET_IN_BITMAP (BITMAP, MIN, node_, bi)	\
! 	{						\
! 	  (BB) = BASIC_BLOCK (node_);			\
! 	  CODE;						\
! 	}						\
      }							\
    while (0)
  
*************** df_bb_reg_info_compute (struct df *df, b
*** 1829,1834 ****
--- 1833,1839 ----
        unsigned int uid = INSN_UID (insn);
        unsigned int regno;
        struct df_link *link;
+       bitmap_iterator bi;
  
        if (! INSN_P (insn))
  	continue;
*************** df_bb_reg_info_compute (struct df *df, b
*** 1854,1863 ****
  	}
  
        /* Increment lifetimes of all live registers.  */
!       EXECUTE_IF_SET_IN_BITMAP (live, 0, regno,
!       {
! 	reg_info[regno].lifetime++;
!       });
      }
  }
  
--- 1859,1868 ----
  	}
  
        /* Increment lifetimes of all live registers.  */
!       EXECUTE_IF_SET_IN_BITMAP (live, 0, regno, bi)
! 	{
! 	  reg_info[regno].lifetime++;
! 	}
      }
  }
  
*************** df_refs_update (struct df *df, bitmap bl
*** 2251,2260 ****
      }
    else
      {
!       EXECUTE_IF_AND_IN_BITMAP (df->bbs_modified, blocks, 0, bbno,
  	{
  	  count += df_bb_refs_update (df, BASIC_BLOCK (bbno));
! 	});
      }
  
    df_refs_process (df);
--- 2256,2267 ----
      }
    else
      {
!       bitmap_iterator bi;
! 
!       EXECUTE_IF_AND_IN_BITMAP (df->bbs_modified, blocks, 0, bbno, bi)
  	{
  	  count += df_bb_refs_update (df, BASIC_BLOCK (bbno));
! 	}
      }
  
    df_refs_process (df);
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.288
diff -c -3 -p -r1.288 except.c
*** except.c	15 Sep 2004 20:47:39 -0000	1.288
--- except.c	25 Sep 2004 22:08:41 -0000
*************** remove_eh_handler (struct eh_region *reg
*** 2274,2281 ****
    if (region->aka)
      {
        int i;
!       EXECUTE_IF_SET_IN_BITMAP (region->aka, 0, i,
! 	{ cfun->eh->region_array[i] = outer; });
      }
  
    if (outer)
--- 2274,2285 ----
    if (region->aka)
      {
        int i;
!       bitmap_iterator bi;
! 
!       EXECUTE_IF_SET_IN_BITMAP (region->aka, 0, i, bi)
! 	{
! 	  cfun->eh->region_array[i] = outer;
! 	}
      }
  
    if (outer)
Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.598
diff -c -3 -p -r1.598 flow.c
*** flow.c	24 Sep 2004 19:47:02 -0000	1.598
--- flow.c	25 Sep 2004 22:08:41 -0000
*************** void
*** 4320,4331 ****
  reg_set_to_hard_reg_set (HARD_REG_SET *to, bitmap from)
  {
    int i;
  
!   EXECUTE_IF_SET_IN_BITMAP
!     (from, 0, i,
!      {
!        if (i >= FIRST_PSEUDO_REGISTER)
! 	 return;
!        SET_HARD_REG_BIT (*to, i);
!      });
  }
--- 4320,4331 ----
  reg_set_to_hard_reg_set (HARD_REG_SET *to, bitmap from)
  {
    int i;
+   bitmap_iterator bi;
  
!   EXECUTE_IF_SET_IN_BITMAP (from, 0, i, bi)
!     {
!       if (i >= FIRST_PSEUDO_REGISTER)
! 	return;
!       SET_HARD_REG_BIT (*to, i);
!     }
  }
Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.316
diff -c -3 -p -r1.316 gcse.c
*** gcse.c	18 Sep 2004 19:47:09 -0000	1.316
--- gcse.c	25 Sep 2004 22:08:41 -0000
*************** static void
*** 2272,2285 ****
  clear_modify_mem_tables (void)
  {
    int i;
  
!   EXECUTE_IF_SET_IN_BITMAP
!     (modify_mem_list_set, 0, i, free_INSN_LIST_list (modify_mem_list + i));
    bitmap_clear (modify_mem_list_set);
  
!   EXECUTE_IF_SET_IN_BITMAP
!     (canon_modify_mem_list_set, 0, i,
!      free_insn_expr_list_list (canon_modify_mem_list + i));
    bitmap_clear (canon_modify_mem_list_set);
  }
  
--- 2272,2289 ----
  clear_modify_mem_tables (void)
  {
    int i;
+   bitmap_iterator bi;
  
!   EXECUTE_IF_SET_IN_BITMAP (modify_mem_list_set, 0, i, bi)
!     {
!       free_INSN_LIST_list (modify_mem_list + i);
!     }
    bitmap_clear (modify_mem_list_set);
  
!   EXECUTE_IF_SET_IN_BITMAP (canon_modify_mem_list_set, 0, i, bi)
!     {
!       free_insn_expr_list_list (canon_modify_mem_list + i);
!     }
    bitmap_clear (canon_modify_mem_list_set);
  }
  
Index: global.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/global.c,v
retrieving revision 1.109
diff -c -3 -p -r1.109 global.c
*** global.c	18 Sep 2004 19:47:09 -0000	1.109
--- global.c	25 Sep 2004 22:08:41 -0000
*************** build_insn_chain (rtx first)
*** 1816,1832 ****
        if (first == BB_HEAD (b))
  	{
  	  int i;
  
  	  CLEAR_REG_SET (live_relevant_regs);
  
! 	  EXECUTE_IF_SET_IN_BITMAP
! 	    (b->global_live_at_start, 0, i,
! 	     {
! 	       if (i < FIRST_PSEUDO_REGISTER
! 		   ? ! TEST_HARD_REG_BIT (eliminable_regset, i)
! 		   : reg_renumber[i] >= 0)
! 		 SET_REGNO_REG_SET (live_relevant_regs, i);
! 	     });
  	}
  
        if (!NOTE_P (first) && !BARRIER_P (first))
--- 1816,1832 ----
        if (first == BB_HEAD (b))
  	{
  	  int i;
+ 	  bitmap_iterator bi;
  
  	  CLEAR_REG_SET (live_relevant_regs);
  
! 	  EXECUTE_IF_SET_IN_BITMAP (b->global_live_at_start, 0, i, bi)
! 	    {
! 	      if (i < FIRST_PSEUDO_REGISTER
! 		  ? ! TEST_HARD_REG_BIT (eliminable_regset, i)
! 		  : reg_renumber[i] >= 0)
! 		SET_REGNO_REG_SET (live_relevant_regs, i);
! 	    }
  	}
  
        if (!NOTE_P (first) && !BARRIER_P (first))
Index: ifcvt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ifcvt.c,v
retrieving revision 1.165
diff -c -3 -p -r1.165 ifcvt.c
*** ifcvt.c	17 Sep 2004 05:32:36 -0000	1.165
--- ifcvt.c	25 Sep 2004 22:08:41 -0000
*************** dead_or_predicable (basic_block test_bb,
*** 3140,3145 ****
--- 3140,3146 ----
        regset merge_set, tmp, test_live, test_set;
        struct propagate_block_info *pbi;
        int i, fail = 0;
+       bitmap_iterator bi;
  
        /* Check for no calls or trapping operations.  */
        for (insn = head; ; insn = NEXT_INSN (insn))
*************** dead_or_predicable (basic_block test_bb,
*** 3191,3204 ****
  	 hard registers before reload.  */
        if (SMALL_REGISTER_CLASSES && ! reload_completed)
  	{
!           EXECUTE_IF_SET_IN_BITMAP
! 	    (merge_set, 0, i,
! 	     {
! 	       if (i < FIRST_PSEUDO_REGISTER
! 		   && ! fixed_regs[i]
! 		   && ! global_regs[i])
  		fail = 1;
! 	     });
  	}
  
        /* For TEST, we're interested in a range of insns, not a whole block.
--- 3192,3204 ----
  	 hard registers before reload.  */
        if (SMALL_REGISTER_CLASSES && ! reload_completed)
  	{
!           EXECUTE_IF_SET_IN_BITMAP (merge_set, 0, i, bi)
! 	    {
! 	      if (i < FIRST_PSEUDO_REGISTER
! 		  && ! fixed_regs[i]
! 		  && ! global_regs[i])
  		fail = 1;
! 	    }
  	}
  
        /* For TEST, we're interested in a range of insns, not a whole block.
*************** dead_or_predicable (basic_block test_bb,
*** 3225,3235 ****
  
        bitmap_operation (tmp, test_set, test_live, BITMAP_IOR);
        bitmap_operation (tmp, tmp, merge_set, BITMAP_AND);
!       EXECUTE_IF_SET_IN_BITMAP(tmp, 0, i, fail = 1);
  
        bitmap_operation (tmp, test_set, merge_bb->global_live_at_start,
  			BITMAP_AND);
!       EXECUTE_IF_SET_IN_BITMAP(tmp, 0, i, fail = 1);
  
        FREE_REG_SET (tmp);
        FREE_REG_SET (merge_set);
--- 3225,3237 ----
  
        bitmap_operation (tmp, test_set, test_live, BITMAP_IOR);
        bitmap_operation (tmp, tmp, merge_set, BITMAP_AND);
!       if (bitmap_first_set_bit (tmp) >= 0)
! 	fail = 1;
  
        bitmap_operation (tmp, test_set, merge_bb->global_live_at_start,
  			BITMAP_AND);
!       if (bitmap_first_set_bit (tmp) >= 0)
! 	fail = 1;
  
        FREE_REG_SET (tmp);
        FREE_REG_SET (merge_set);
Index: loop-invariant.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-invariant.c,v
retrieving revision 2.6
diff -c -3 -p -r2.6 loop-invariant.c
*** loop-invariant.c	12 Sep 2004 05:51:01 -0000	2.6
--- loop-invariant.c	25 Sep 2004 22:08:41 -0000
*************** get_inv_cost (struct invariant *inv, int
*** 599,604 ****
--- 599,605 ----
    unsigned aregs_needed;
    unsigned depno;
    struct invariant *dep;
+   bitmap_iterator bi;
  
    *comp_cost = 0;
    *regs_needed = 0;
*************** get_inv_cost (struct invariant *inv, int
*** 610,616 ****
    (*regs_needed)++;
    (*comp_cost) += inv->cost;
  
!   EXECUTE_IF_SET_IN_BITMAP (inv->depends_on, 0, depno,
      {
        dep = VARRAY_GENERIC_PTR_NOGC (invariants, depno);
  
--- 611,617 ----
    (*regs_needed)++;
    (*comp_cost) += inv->cost;
  
!   EXECUTE_IF_SET_IN_BITMAP (inv->depends_on, 0, depno, bi)
      {
        dep = VARRAY_GENERIC_PTR_NOGC (invariants, depno);
  
*************** get_inv_cost (struct invariant *inv, int
*** 631,637 ****
  
        (*regs_needed) += aregs_needed;
        (*comp_cost) += acomp_cost;
!     });
  }
  
  /* Calculates gain for eliminating invariant INV.  REGS_USED is the number
--- 632,638 ----
  
        (*regs_needed) += aregs_needed;
        (*comp_cost) += acomp_cost;
!     }
  }
  
  /* Calculates gain for eliminating invariant INV.  REGS_USED is the number
*************** static void
*** 696,701 ****
--- 697,703 ----
  set_move_mark (unsigned invno)
  {
    struct invariant *inv = VARRAY_GENERIC_PTR_NOGC (invariants, invno);
+   bitmap_iterator bi;
  
    if (inv->move)
      return;
*************** set_move_mark (unsigned invno)
*** 704,710 ****
    if (dump_file)
      fprintf (dump_file, "Decided to move invariant %d\n", invno);
  
!   EXECUTE_IF_SET_IN_BITMAP (inv->depends_on, 0, invno, set_move_mark (invno));
  }
  
  /* Determines which invariants to move.  DF is the dataflow object.  */
--- 706,715 ----
    if (dump_file)
      fprintf (dump_file, "Decided to move invariant %d\n", invno);
  
!   EXECUTE_IF_SET_IN_BITMAP (inv->depends_on, 0, invno, bi)
!     {
!       set_move_mark (invno);
!     }
  }
  
  /* Determines which invariants to move.  DF is the dataflow object.  */
*************** move_invariant_reg (struct loop *loop, u
*** 761,766 ****
--- 766,772 ----
    basic_block preheader = loop_preheader_edge (loop)->src;
    rtx reg, set;
    struct use *use;
+   bitmap_iterator bi;
  
    if (inv->processed)
      return;
*************** move_invariant_reg (struct loop *loop, u
*** 768,777 ****
  
    if (inv->depends_on)
      {
!       EXECUTE_IF_SET_IN_BITMAP (inv->depends_on, 0, i,
  	{
  	  move_invariant_reg (loop, i, df);
! 	});
      }
  
    /* Move the set out of the loop.  If the set is always executed (we could
--- 774,783 ----
  
    if (inv->depends_on)
      {
!       EXECUTE_IF_SET_IN_BITMAP (inv->depends_on, 0, i, bi)
  	{
  	  move_invariant_reg (loop, i, df);
! 	}
      }
  
    /* Move the set out of the loop.  If the set is always executed (we could
Index: ra-build.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-build.c,v
retrieving revision 1.33
diff -c -3 -p -r1.33 ra-build.c
*** ra-build.c	9 Sep 2004 17:19:09 -0000	1.33
--- ra-build.c	25 Sep 2004 22:08:41 -0000
*************** livethrough_conflicts_bb (basic_block bb
*** 1056,1072 ****
    if (deaths > 0
        || contains_call
        || bitmap_first_set_bit (all_defs) >= 0)
!     EXECUTE_IF_SET_IN_BITMAP (info->live_throughout, first, use_id,
!       {
!         struct web_part *wp = &web_parts[df->def_id + use_id];
!         unsigned int bl = rtx_to_bits (DF_REF_REG (wp->ref));
!         bitmap conflicts;
!         wp = find_web_part (wp);
!         wp->spanned_deaths += deaths;
! 	wp->crosses_call |= contains_call;
!         conflicts = get_sub_conflicts (wp, bl);
!         bitmap_operation (conflicts, conflicts, all_defs, BITMAP_IOR);
!       });
  
    BITMAP_XFREE (all_defs);
  }
--- 1056,1076 ----
    if (deaths > 0
        || contains_call
        || bitmap_first_set_bit (all_defs) >= 0)
!     {
!       bitmap_iterator bi;
! 
!       EXECUTE_IF_SET_IN_BITMAP (info->live_throughout, first, use_id, bi)
! 	{
! 	  struct web_part *wp = &web_parts[df->def_id + use_id];
! 	  unsigned int bl = rtx_to_bits (DF_REF_REG (wp->ref));
! 	  bitmap conflicts;
! 	  wp = find_web_part (wp);
! 	  wp->spanned_deaths += deaths;
! 	  wp->crosses_call |= contains_call;
! 	  conflicts = get_sub_conflicts (wp, bl);
! 	  bitmap_operation (conflicts, conflicts, all_defs, BITMAP_IOR);
! 	}
!     }
  
    BITMAP_XFREE (all_defs);
  }
*************** conflicts_between_webs (struct df *df)
*** 2191,2196 ****
--- 2195,2202 ----
  	  {
  	    int j;
  	    struct web *web1 = find_subweb_2 (supweb1, cl->size_word);
+ 	    bitmap_iterator bi;
+ 
  	    if (have_ignored)
  	      bitmap_operation (cl->conflicts, cl->conflicts, ignore_defs,
  			        BITMAP_AND_COMPL);
*************** conflicts_between_webs (struct df *df)
*** 2205,2212 ****
  	    pass++;
  
  	    /* Note, that there are only defs in the conflicts bitset.  */
! 	    EXECUTE_IF_SET_IN_BITMAP (
! 	      cl->conflicts, 0, j,
  	      {
  		struct web *web2 = def2web[j];
  		unsigned int id2 = web2->id;
--- 2211,2217 ----
  	    pass++;
  
  	    /* Note, that there are only defs in the conflicts bitset.  */
! 	    EXECUTE_IF_SET_IN_BITMAP (cl->conflicts, 0, j, bi)
  	      {
  		struct web *web2 = def2web[j];
  		unsigned int id2 = web2->id;
*************** conflicts_between_webs (struct df *df)
*** 2215,2221 ****
  		    pass_cache[id2] = pass;
  		    record_conflict (web1, web2);
  		  }
! 	      });
  	  }
      }
  
--- 2220,2226 ----
  		    pass_cache[id2] = pass;
  		    record_conflict (web1, web2);
  		  }
! 	      }
  	  }
      }
  
Index: ra-rewrite.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-rewrite.c,v
retrieving revision 1.26
diff -c -3 -p -r1.26 ra-rewrite.c
*** ra-rewrite.c	9 Sep 2004 17:19:11 -0000	1.26
--- ra-rewrite.c	25 Sep 2004 22:08:41 -0000
*************** reloads_to_loads (struct rewrite_info *r
*** 1013,1020 ****
        if (is_death)
  	{
  	  int old_num_r = num_reloads;
  	  bitmap_clear (ri->scratch);
! 	  EXECUTE_IF_SET_IN_BITMAP (ri->need_reload, 0, j,
  	    {
  	      struct web *web2 = ID2WEB (j);
  	      struct web *aweb2 = alias (find_web_for_subweb (web2));
--- 1013,1022 ----
        if (is_death)
  	{
  	  int old_num_r = num_reloads;
+ 	  bitmap_iterator bi;
+ 
  	  bitmap_clear (ri->scratch);
! 	  EXECUTE_IF_SET_IN_BITMAP (ri->need_reload, 0, j, bi)
  	    {
  	      struct web *web2 = ID2WEB (j);
  	      struct web *aweb2 = alias (find_web_for_subweb (web2));
*************** reloads_to_loads (struct rewrite_info *r
*** 1030,1036 ****
  		  bitmap_set_bit (ri->scratch, j);
  		  num_reloads--;
  		}
! 	    });
  	  if (num_reloads != old_num_r)
  	    bitmap_operation (ri->need_reload, ri->need_reload, ri->scratch,
  			      BITMAP_AND_COMPL);
--- 1032,1038 ----
  		  bitmap_set_bit (ri->scratch, j);
  		  num_reloads--;
  		}
! 	    }
  	  if (num_reloads != old_num_r)
  	    bitmap_operation (ri->need_reload, ri->need_reload, ri->scratch,
  			      BITMAP_AND_COMPL);
*************** rewrite_program2 (bitmap new_deaths)
*** 1062,1067 ****
--- 1064,1071 ----
        basic_block last_bb = NULL;
        rtx last_block_insn;
        int i, j;
+       bitmap_iterator bi;
+ 
        if (!INSN_P (insn))
  	insn = prev_real_insn (insn);
        while (insn && !(bb = BLOCK_FOR_INSN (insn)))
*************** rewrite_program2 (bitmap new_deaths)
*** 1073,1079 ****
  
        sbitmap_zero (ri.live);
        CLEAR_HARD_REG_SET (ri.colors_in_use);
!       EXECUTE_IF_SET_IN_BITMAP (live_at_end[i - 2], 0, j,
  	{
  	  struct web *web = use2web[j];
  	  struct web *aweb = alias (find_web_for_subweb (web));
--- 1077,1083 ----
  
        sbitmap_zero (ri.live);
        CLEAR_HARD_REG_SET (ri.colors_in_use);
!       EXECUTE_IF_SET_IN_BITMAP (live_at_end[i - 2], 0, j, bi)
  	{
  	  struct web *web = use2web[j];
  	  struct web *aweb = alias (find_web_for_subweb (web));
*************** rewrite_program2 (bitmap new_deaths)
*** 1090,1096 ****
  	      if (aweb->type != SPILLED)
  	        update_spill_colors (&(ri.colors_in_use), web, 1);
  	    }
! 	});
  
        bitmap_clear (ri.need_reload);
        ri.num_reloads = 0;
--- 1094,1100 ----
  	      if (aweb->type != SPILLED)
  	        update_spill_colors (&(ri.colors_in_use), web, 1);
  	    }
! 	}
  
        bitmap_clear (ri.need_reload);
        ri.num_reloads = 0;
*************** rewrite_program2 (bitmap new_deaths)
*** 1130,1136 ****
  	  if (INSN_P (insn) && BLOCK_FOR_INSN (insn) != last_bb)
  	    {
  	      int index = BLOCK_FOR_INSN (insn)->index + 2;
! 	      EXECUTE_IF_SET_IN_BITMAP (live_at_end[index - 2], 0, j,
  		{
  		  struct web *web = use2web[j];
  		  struct web *aweb = alias (find_web_for_subweb (web));
--- 1134,1142 ----
  	  if (INSN_P (insn) && BLOCK_FOR_INSN (insn) != last_bb)
  	    {
  	      int index = BLOCK_FOR_INSN (insn)->index + 2;
! 	      bitmap_iterator bi;
! 
! 	      EXECUTE_IF_SET_IN_BITMAP (live_at_end[index - 2], 0, j, bi)
  		{
  		  struct web *web = use2web[j];
  		  struct web *aweb = alias (find_web_for_subweb (web));
*************** rewrite_program2 (bitmap new_deaths)
*** 1139,1147 ****
  		      SET_BIT (ri.live, web->id);
  		      update_spill_colors (&(ri.colors_in_use), web, 1);
  		    }
! 		});
  	      bitmap_clear (ri.scratch);
! 	      EXECUTE_IF_SET_IN_BITMAP (ri.need_reload, 0, j,
  		{
  		  struct web *web2 = ID2WEB (j);
  		  struct web *supweb2 = find_web_for_subweb (web2);
--- 1145,1153 ----
  		      SET_BIT (ri.live, web->id);
  		      update_spill_colors (&(ri.colors_in_use), web, 1);
  		    }
! 		}
  	      bitmap_clear (ri.scratch);
! 	      EXECUTE_IF_SET_IN_BITMAP (ri.need_reload, 0, j, bi)
  		{
  		  struct web *web2 = ID2WEB (j);
  		  struct web *supweb2 = find_web_for_subweb (web2);
*************** rewrite_program2 (bitmap new_deaths)
*** 1156,1162 ****
  		      bitmap_set_bit (ri.scratch, j);
  		      ri.num_reloads--;
  		    }
! 		});
  	      bitmap_operation (ri.need_reload, ri.need_reload, ri.scratch,
  				BITMAP_AND_COMPL);
  	      last_bb = BLOCK_FOR_INSN (insn);
--- 1162,1168 ----
  		      bitmap_set_bit (ri.scratch, j);
  		      ri.num_reloads--;
  		    }
! 		}
  	      bitmap_operation (ri.need_reload, ri.need_reload, ri.scratch,
  				BITMAP_AND_COMPL);
  	      last_bb = BLOCK_FOR_INSN (insn);
*************** rewrite_program2 (bitmap new_deaths)
*** 1344,1369 ****
  	  int in_ir = 0;
  	  edge e;
  	  int num = 0;
  	  HARD_REG_SET cum_colors, colors;
  	  CLEAR_HARD_REG_SET (cum_colors);
  	  for (e = bb->pred; e && num < 5; e = e->pred_next, num++)
  	    {
  	      int j;
  	      CLEAR_HARD_REG_SET (colors);
! 	      EXECUTE_IF_SET_IN_BITMAP (live_at_end[e->src->index], 0, j,
  		{
  		  struct web *web = use2web[j];
  		  struct web *aweb = alias (find_web_for_subweb (web));
  		  if (aweb->type != SPILLED)
  		    update_spill_colors (&colors, web, 1);
! 		});
  	      IOR_HARD_REG_SET (cum_colors, colors);
  	    }
  	  if (num == 5)
  	    in_ir = 1;
  
  	  bitmap_clear (ri.scratch);
! 	  EXECUTE_IF_SET_IN_BITMAP (ri.need_reload, 0, j,
  	    {
  	      struct web *web2 = ID2WEB (j);
  	      struct web *supweb2 = find_web_for_subweb (web2);
--- 1350,1377 ----
  	  int in_ir = 0;
  	  edge e;
  	  int num = 0;
+ 	  bitmap_iterator bi;
+ 
  	  HARD_REG_SET cum_colors, colors;
  	  CLEAR_HARD_REG_SET (cum_colors);
  	  for (e = bb->pred; e && num < 5; e = e->pred_next, num++)
  	    {
  	      int j;
  	      CLEAR_HARD_REG_SET (colors);
! 	      EXECUTE_IF_SET_IN_BITMAP (live_at_end[e->src->index], 0, j, bi)
  		{
  		  struct web *web = use2web[j];
  		  struct web *aweb = alias (find_web_for_subweb (web));
  		  if (aweb->type != SPILLED)
  		    update_spill_colors (&colors, web, 1);
! 		}
  	      IOR_HARD_REG_SET (cum_colors, colors);
  	    }
  	  if (num == 5)
  	    in_ir = 1;
  
  	  bitmap_clear (ri.scratch);
! 	  EXECUTE_IF_SET_IN_BITMAP (ri.need_reload, 0, j, bi)
  	    {
  	      struct web *web2 = ID2WEB (j);
  	      struct web *supweb2 = find_web_for_subweb (web2);
*************** rewrite_program2 (bitmap new_deaths)
*** 1384,1390 ****
  		  bitmap_set_bit (ri.scratch, j);
  		  ri.num_reloads--;
  		}
! 	    });
  	  bitmap_operation (ri.need_reload, ri.need_reload, ri.scratch,
  			    BITMAP_AND_COMPL);
  	}
--- 1392,1398 ----
  		  bitmap_set_bit (ri.scratch, j);
  		  ri.num_reloads--;
  		}
! 	  }
  	  bitmap_operation (ri.need_reload, ri.need_reload, ri.scratch,
  			    BITMAP_AND_COMPL);
  	}
*************** detect_web_parts_to_rebuild (void)
*** 1458,1463 ****
--- 1466,1473 ----
          struct web *web = DLIST_WEB (d);
  	struct conflict_link *wl;
  	unsigned int j;
+ 	bitmap_iterator bi;
+ 
  	/* This check is only needed for coalesced nodes, but hey.  */
  	if (alias (web)->type != SPILLED)
  	  continue;
*************** detect_web_parts_to_rebuild (void)
*** 1494,1507 ****
  	    SET_BIT (already_webs, wl->t->id);
  	    mark_refs_for_checking (wl->t, uses_as_bitmap);
  	  }
! 	EXECUTE_IF_SET_IN_BITMAP (web->useless_conflicts, 0, j,
  	  {
  	    struct web *web2 = ID2WEB (j);
  	    if (TEST_BIT (already_webs, web2->id))
  	      continue;
  	    SET_BIT (already_webs, web2->id);
  	    mark_refs_for_checking (web2, uses_as_bitmap);
! 	  });
        }
  
    /* We also recheck unconditionally all uses of any hardregs.  This means
--- 1504,1517 ----
  	    SET_BIT (already_webs, wl->t->id);
  	    mark_refs_for_checking (wl->t, uses_as_bitmap);
  	  }
! 	EXECUTE_IF_SET_IN_BITMAP (web->useless_conflicts, 0, j, bi)
  	  {
  	    struct web *web2 = ID2WEB (j);
  	    if (TEST_BIT (already_webs, web2->id))
  	      continue;
  	    SET_BIT (already_webs, web2->id);
  	    mark_refs_for_checking (web2, uses_as_bitmap);
! 	  }
        }
  
    /* We also recheck unconditionally all uses of any hardregs.  This means
*************** static void
*** 1550,1559 ****
  delete_useless_defs (void)
  {
    unsigned int i;
    /* If the insn only sets the def without any sideeffect (besides
       clobbers or uses), we can delete it.  single_set() also tests
       for INSN_P(insn).  */
!   EXECUTE_IF_SET_IN_BITMAP (useless_defs, 0, i,
      {
        rtx insn = DF_REF_INSN (df->defs[i]);
        rtx set = single_set (insn);
--- 1560,1571 ----
  delete_useless_defs (void)
  {
    unsigned int i;
+   bitmap_iterator bi;
+ 
    /* If the insn only sets the def without any sideeffect (besides
       clobbers or uses), we can delete it.  single_set() also tests
       for INSN_P(insn).  */
!   EXECUTE_IF_SET_IN_BITMAP (useless_defs, 0, i, bi)
      {
        rtx insn = DF_REF_INSN (df->defs[i]);
        rtx set = single_set (insn);
*************** delete_useless_defs (void)
*** 1566,1572 ****
  	  NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
  	  df_insn_modify (df, BLOCK_FOR_INSN (insn), insn);
  	}
!     });
  }
  
  /* Look for spilled webs, on whose behalf no insns were emitted.
--- 1578,1584 ----
  	  NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
  	  df_insn_modify (df, BLOCK_FOR_INSN (insn), insn);
  	}
!     }
  }
  
  /* Look for spilled webs, on whose behalf no insns were emitted.
*************** void
*** 1617,1623 ****
--- 1629,1637 ----
  actual_spill (void)
  {
    int i;
+   bitmap_iterator bi;
    bitmap new_deaths = BITMAP_XMALLOC ();
+ 
    reset_changed_flag ();
    spill_coalprop ();
    choose_spill_colors ();
*************** actual_spill (void)
*** 1633,1640 ****
    insns_with_deaths = sbitmap_alloc (get_max_uid ());
    death_insns_max_uid = get_max_uid ();
    sbitmap_zero (insns_with_deaths);
!   EXECUTE_IF_SET_IN_BITMAP (new_deaths, 0, i,
!     { SET_BIT (insns_with_deaths, i);});
    detect_non_changed_webs ();
    detect_web_parts_to_rebuild ();
    BITMAP_XFREE (new_deaths);
--- 1647,1656 ----
    insns_with_deaths = sbitmap_alloc (get_max_uid ());
    death_insns_max_uid = get_max_uid ();
    sbitmap_zero (insns_with_deaths);
!   EXECUTE_IF_SET_IN_BITMAP (new_deaths, 0, i, bi)
!     {
!       SET_BIT (insns_with_deaths, i);
!     }
    detect_non_changed_webs ();
    detect_web_parts_to_rebuild ();
    BITMAP_XFREE (new_deaths);
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.57
diff -c -3 -p -r2.57 tree-cfg.c
*** tree-cfg.c	22 Sep 2004 11:40:12 -0000	2.57
--- tree-cfg.c	25 Sep 2004 22:08:41 -0000
*************** allocate_ssa_names (bitmap definitions, 
*** 4386,4396 ****
    struct ssa_name_map_entry *entry;
    PTR *slot;
    unsigned ver;
  
    if (!*map)
      *map = htab_create (10, ssa_name_map_entry_hash,
  			ssa_name_map_entry_eq, free);
!   EXECUTE_IF_SET_IN_BITMAP (definitions, 0, ver,
      {
        name = ssa_name (ver);
        slot = htab_find_slot_with_hash (*map, name, SSA_NAME_VERSION (name),
--- 4386,4397 ----
    struct ssa_name_map_entry *entry;
    PTR *slot;
    unsigned ver;
+   bitmap_iterator bi;
  
    if (!*map)
      *map = htab_create (10, ssa_name_map_entry_hash,
  			ssa_name_map_entry_eq, free);
!   EXECUTE_IF_SET_IN_BITMAP (definitions, 0, ver, bi)
      {
        name = ssa_name (ver);
        slot = htab_find_slot_with_hash (*map, name, SSA_NAME_VERSION (name),
*************** allocate_ssa_names (bitmap definitions, 
*** 4404,4410 ****
  	  *slot = entry;
  	}
        entry->to_name = duplicate_ssa_name (name, SSA_NAME_DEF_STMT (name));
!     });
  }
  
  /* Rewrite the definition DEF in statement STMT to new ssa name as specified
--- 4405,4411 ----
  	  *slot = entry;
  	}
        entry->to_name = duplicate_ssa_name (name, SSA_NAME_DEF_STMT (name));
!     }
  }
  
  /* Rewrite the definition DEF in statement STMT to new ssa name as specified
*************** tree_duplicate_sese_region (edge entry, 
*** 4555,4560 ****
--- 4556,4562 ----
    basic_block *doms;
    htab_t ssa_name_map = NULL;
    edge redirected;
+   bitmap_iterator bi;
  
    if (!can_copy_bbs_p (region, n_region))
      return false;
*************** tree_duplicate_sese_region (edge entry, 
*** 4639,4645 ****
    /* Add phi nodes for definitions at exit.  TODO -- once we have immediate
       uses, it should be possible to emit phi nodes just for definitions that
       are used outside region.  */
!   EXECUTE_IF_SET_IN_BITMAP (definitions, 0, ver,
      {
        tree name = ssa_name (ver);
  
--- 4641,4647 ----
    /* Add phi nodes for definitions at exit.  TODO -- once we have immediate
       uses, it should be possible to emit phi nodes just for definitions that
       are used outside region.  */
!   EXECUTE_IF_SET_IN_BITMAP (definitions, 0, ver, bi)
      {
        tree name = ssa_name (ver);
  
*************** tree_duplicate_sese_region (edge entry, 
*** 4648,4654 ****
        add_phi_arg (&phi, name, exit_copy);
  
        SSA_NAME_DEF_STMT (name) = phi;
!     });
  
    /* And create new definitions inside region and its copy.  TODO -- once we
       have immediate uses, it might be better to leave definitions in region
--- 4650,4656 ----
        add_phi_arg (&phi, name, exit_copy);
  
        SSA_NAME_DEF_STMT (name) = phi;
!     }
  
    /* And create new definitions inside region and its copy.  TODO -- once we
       have immediate uses, it might be better to leave definitions in region
*************** tree_purge_all_dead_eh_edges (bitmap blo
*** 5070,5078 ****
  {
    bool changed = false;
    size_t i;
  
!   EXECUTE_IF_SET_IN_BITMAP (blocks, 0, i,
!     { changed |= tree_purge_dead_eh_edges (BASIC_BLOCK (i)); });
  
    return changed;
  }
--- 5072,5083 ----
  {
    bool changed = false;
    size_t i;
+   bitmap_iterator bi;
  
!   EXECUTE_IF_SET_IN_BITMAP (blocks, 0, i, bi)
!     {
!       changed |= tree_purge_dead_eh_edges (BASIC_BLOCK (i));
!     }
  
    return changed;
  }
Index: tree-into-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-into-ssa.c,v
retrieving revision 2.21
diff -c -3 -p -r2.21 tree-into-ssa.c
*** tree-into-ssa.c	18 Sep 2004 07:31:29 -0000	2.21
--- tree-into-ssa.c	25 Sep 2004 22:08:41 -0000
*************** compute_global_livein (bitmap livein, bi
*** 231,244 ****
  {
    basic_block bb, *worklist, *tos;
    int i;
  
    tos = worklist
      = (basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
  
!   EXECUTE_IF_SET_IN_BITMAP (livein, 0, i,
      {
! 	*tos++ = BASIC_BLOCK (i);
!     });
  
    /* Iterate until the worklist is empty.  */
    while (tos != worklist)
--- 231,245 ----
  {
    basic_block bb, *worklist, *tos;
    int i;
+   bitmap_iterator bi;
  
    tos = worklist
      = (basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
  
!   EXECUTE_IF_SET_IN_BITMAP (livein, 0, i, bi)
      {
!       *tos++ = BASIC_BLOCK (i);
!     }
  
    /* Iterate until the worklist is empty.  */
    while (tos != worklist)
*************** insert_phi_nodes (bitmap *dfs, bitmap na
*** 602,607 ****
--- 603,609 ----
  {
    size_t i;
    varray_type work_stack;
+   bitmap_iterator bi;
  
    timevar_push (TV_TREE_INSERT_PHI_NODES);
  
*************** insert_phi_nodes (bitmap *dfs, bitmap na
*** 615,629 ****
       each definition block.  */
    if (names_to_rename)
      {
!       EXECUTE_IF_SET_IN_BITMAP (names_to_rename, 0, i,
  	{
  	  if (ssa_name (i))
  	    insert_phi_nodes_1 (ssa_name (i), dfs, &work_stack);
! 	});
      }
    else if (vars_to_rename)
!     EXECUTE_IF_SET_IN_BITMAP (vars_to_rename, 0, i,
! 	insert_phi_nodes_1 (referenced_var (i), dfs, &work_stack));
    else
      for (i = 0; i < num_referenced_vars; i++)
        insert_phi_nodes_1 (referenced_var (i), dfs, &work_stack);
--- 617,633 ----
       each definition block.  */
    if (names_to_rename)
      {
!       EXECUTE_IF_SET_IN_BITMAP (names_to_rename, 0, i, bi)
  	{
  	  if (ssa_name (i))
  	    insert_phi_nodes_1 (ssa_name (i), dfs, &work_stack);
! 	}
      }
    else if (vars_to_rename)
!     EXECUTE_IF_SET_IN_BITMAP (vars_to_rename, 0, i, bi)
!       {
! 	insert_phi_nodes_1 (referenced_var (i), dfs, &work_stack);
!       }
    else
      for (i = 0; i < num_referenced_vars; i++)
        insert_phi_nodes_1 (referenced_var (i), dfs, &work_stack);
*************** insert_phi_nodes_for (tree var, bitmap *
*** 964,969 ****
--- 968,974 ----
    edge e;
    tree phi;
    basic_block bb;
+   bitmap_iterator bi;
  
    def_map = find_def_blocks_for (var);
    if (def_map == NULL)
*************** insert_phi_nodes_for (tree var, bitmap *
*** 971,980 ****
  
    phi_insertion_points = BITMAP_XMALLOC ();
  
!   EXECUTE_IF_SET_IN_BITMAP (def_map->def_blocks, 0, bb_index,
      {
        VARRAY_PUSH_GENERIC_PTR_NOGC (*work_stack, BASIC_BLOCK (bb_index));
!     });
  
    /* Pop a block off the worklist, add every block that appears in
       the original block's dfs that we have not already processed to
--- 976,985 ----
  
    phi_insertion_points = BITMAP_XMALLOC ();
  
!   EXECUTE_IF_SET_IN_BITMAP (def_map->def_blocks, 0, bb_index, bi)
      {
        VARRAY_PUSH_GENERIC_PTR_NOGC (*work_stack, BASIC_BLOCK (bb_index));
!     }
  
    /* Pop a block off the worklist, add every block that appears in
       the original block's dfs that we have not already processed to
*************** insert_phi_nodes_for (tree var, bitmap *
*** 991,996 ****
--- 996,1002 ----
    while (VARRAY_ACTIVE_SIZE (*work_stack) > 0)
      {
        int dfs_index;
+       bitmap_iterator bi;
  
        bb = VARRAY_TOP_GENERIC_PTR_NOGC (*work_stack);
        bb_index = bb->index;
*************** insert_phi_nodes_for (tree var, bitmap *
*** 999,1011 ****
        
        EXECUTE_IF_AND_COMPL_IN_BITMAP (dfs[bb_index],
  				      phi_insertion_points,
! 				      0, dfs_index,
  	{
  	  basic_block bb = BASIC_BLOCK (dfs_index);
  
  	  VARRAY_PUSH_GENERIC_PTR_NOGC (*work_stack, bb);
  	  bitmap_set_bit (phi_insertion_points, dfs_index);
! 	});
      }
  
    /* Remove the blocks where we already have the phis.  */
--- 1005,1017 ----
        
        EXECUTE_IF_AND_COMPL_IN_BITMAP (dfs[bb_index],
  				      phi_insertion_points,
! 				      0, dfs_index, bi)
  	{
  	  basic_block bb = BASIC_BLOCK (dfs_index);
  
  	  VARRAY_PUSH_GENERIC_PTR_NOGC (*work_stack, bb);
  	  bitmap_set_bit (phi_insertion_points, dfs_index);
! 	}
      }
  
    /* Remove the blocks where we already have the phis.  */
*************** insert_phi_nodes_for (tree var, bitmap *
*** 1018,1038 ****
  
    /* And insert the PHI nodes.  */
    EXECUTE_IF_AND_IN_BITMAP (phi_insertion_points, def_map->livein_blocks,
! 			    0, bb_index,
!     do
!       {
! 	bb = BASIC_BLOCK (bb_index);
  
! 	phi = create_phi_node (var, bb);
  
! 	/* If we are rewriting ssa names, add also the phi arguments.  */
! 	if (TREE_CODE (var) == SSA_NAME)
! 	  {
! 	    for (e = bb->pred; e; e = e->pred_next)
! 	      add_phi_arg (&phi, var, e);
! 	  }
!       }
!     while (0));
  
    BITMAP_XFREE (phi_insertion_points);
  }
--- 1024,1042 ----
  
    /* And insert the PHI nodes.  */
    EXECUTE_IF_AND_IN_BITMAP (phi_insertion_points, def_map->livein_blocks,
! 			    0, bb_index, bi)
!     {
!       bb = BASIC_BLOCK (bb_index);
  
!       phi = create_phi_node (var, bb);
  
!       /* If we are rewriting ssa names, add also the phi arguments.  */
!       if (TREE_CODE (var) == SSA_NAME)
! 	{
! 	  for (e = bb->pred; e; e = e->pred_next)
! 	    add_phi_arg (&phi, var, e);
! 	}
!     }
  
    BITMAP_XFREE (phi_insertion_points);
  }
*************** debug_def_blocks_r (void **slot, void *d
*** 1260,1275 ****
  {
    unsigned long i;
    struct def_blocks_d *db_p = (struct def_blocks_d *) *slot;
    
    fprintf (stderr, "VAR: ");
    print_generic_expr (stderr, db_p->var, dump_flags);
    fprintf (stderr, ", DEF_BLOCKS: { ");
!   EXECUTE_IF_SET_IN_BITMAP (db_p->def_blocks, 0, i,
! 			    fprintf (stderr, "%ld ", i));
    fprintf (stderr, "}");
    fprintf (stderr, ", LIVEIN_BLOCKS: { ");
!   EXECUTE_IF_SET_IN_BITMAP (db_p->livein_blocks, 0, i,
! 			    fprintf (stderr, "%ld ", i));
    fprintf (stderr, "}\n");
  
    return 1;
--- 1264,1284 ----
  {
    unsigned long i;
    struct def_blocks_d *db_p = (struct def_blocks_d *) *slot;
+   bitmap_iterator bi;
    
    fprintf (stderr, "VAR: ");
    print_generic_expr (stderr, db_p->var, dump_flags);
    fprintf (stderr, ", DEF_BLOCKS: { ");
!   EXECUTE_IF_SET_IN_BITMAP (db_p->def_blocks, 0, i, bi)
!     {
!       fprintf (stderr, "%ld ", i);
!     }
    fprintf (stderr, "}");
    fprintf (stderr, ", LIVEIN_BLOCKS: { ");
!   EXECUTE_IF_SET_IN_BITMAP (db_p->livein_blocks, 0, i, bi)
!     {
!       fprintf (stderr, "%ld ", i);
!     }
    fprintf (stderr, "}\n");
  
    return 1;
*************** invalidate_name_tags (bitmap vars_to_ren
*** 1334,1347 ****
  {
    size_t i;
    bool rename_name_tags_p;
  
    rename_name_tags_p = false;
!   EXECUTE_IF_SET_IN_BITMAP (vars_to_rename, 0, i,
        if (POINTER_TYPE_P (TREE_TYPE (referenced_var (i))))
  	{
  	  rename_name_tags_p = true;
  	  break;
! 	});
  
    if (rename_name_tags_p)
      for (i = 0; i < num_referenced_vars; i++)
--- 1343,1359 ----
  {
    size_t i;
    bool rename_name_tags_p;
+   bitmap_iterator bi;
  
    rename_name_tags_p = false;
!   EXECUTE_IF_SET_IN_BITMAP (vars_to_rename, 0, i, bi)
!     {
        if (POINTER_TYPE_P (TREE_TYPE (referenced_var (i))))
  	{
  	  rename_name_tags_p = true;
  	  break;
! 	}
!     }
  
    if (rename_name_tags_p)
      for (i = 0; i < num_referenced_vars; i++)
*************** rewrite_ssa_into_ssa (void)
*** 1550,1555 ****
--- 1562,1568 ----
    sbitmap snames_to_rename;
    tree name;
    bitmap to_rename;
+   bitmap_iterator bi;
    
    if (!any_marked_for_rewrite_p ())
      return;
*************** rewrite_ssa_into_ssa (void)
*** 1598,1605 ****
  
    snames_to_rename = sbitmap_alloc (num_ssa_names);
    sbitmap_zero (snames_to_rename);
!   EXECUTE_IF_SET_IN_BITMAP (to_rename, 0, i,
! 			    SET_BIT (snames_to_rename, i));
  
    mark_def_sites_global_data.kills = sbitmap_alloc (num_ssa_names);
    mark_def_sites_global_data.names_to_rename = snames_to_rename;
--- 1611,1620 ----
  
    snames_to_rename = sbitmap_alloc (num_ssa_names);
    sbitmap_zero (snames_to_rename);
!   EXECUTE_IF_SET_IN_BITMAP (to_rename, 0, i, bi)
!     {
!       SET_BIT (snames_to_rename, i);
!     }
  
    mark_def_sites_global_data.kills = sbitmap_alloc (num_ssa_names);
    mark_def_sites_global_data.names_to_rename = snames_to_rename;
*************** rewrite_ssa_into_ssa (void)
*** 1657,1663 ****
  
    unmark_all_for_rewrite ();
  
!   EXECUTE_IF_SET_IN_BITMAP (to_rename, 0, i, release_ssa_name (ssa_name (i)));
  
    sbitmap_free (snames_to_rename);
  
--- 1672,1681 ----
  
    unmark_all_for_rewrite ();
  
!   EXECUTE_IF_SET_IN_BITMAP (to_rename, 0, i, bi)
!     {
!       release_ssa_name (ssa_name (i));
!     }
  
    sbitmap_free (snames_to_rename);
  
Index: tree-outof-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-outof-ssa.c,v
retrieving revision 2.22
diff -c -3 -p -r2.22 tree-outof-ssa.c
*** tree-outof-ssa.c	17 Sep 2004 21:54:41 -0000	2.22
--- tree-outof-ssa.c	25 Sep 2004 22:08:41 -0000
*************** find_replaceable_exprs (var_map map)
*** 1706,1716 ****
    table = new_temp_expr_table (map);
    FOR_EACH_BB (bb)
      {
        find_replaceable_in_bb (table, bb);
!       EXECUTE_IF_SET_IN_BITMAP ((table->partition_in_use), 0, i,
          {
  	  kill_expr (table, i, false);
! 	});
      }
  
    ret = free_temp_expr_table (table);
--- 1706,1718 ----
    table = new_temp_expr_table (map);
    FOR_EACH_BB (bb)
      {
+       bitmap_iterator bi;
+ 
        find_replaceable_in_bb (table, bb);
!       EXECUTE_IF_SET_IN_BITMAP ((table->partition_in_use), 0, i, bi)
          {
  	  kill_expr (table, i, false);
! 	}
      }
  
    ret = free_temp_expr_table (table);
Index: tree-sra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-sra.c,v
retrieving revision 2.35
diff -c -3 -p -r2.35 tree-sra.c
*** tree-sra.c	23 Sep 2004 21:00:55 -0000	2.35
--- tree-sra.c	25 Sep 2004 22:08:41 -0000
*************** scan_function (void)
*** 1011,1016 ****
--- 1011,1017 ----
    static const struct sra_walk_fns fns = {
      scan_use, scan_copy, scan_init, scan_ldst, true
    };
+   bitmap_iterator bi;
  
    sra_walk_function (&fns);
  
*************** scan_function (void)
*** 1019,1031 ****
        size_t i;
  
        fputs ("\nScan results:\n", dump_file);
!       EXECUTE_IF_SET_IN_BITMAP (sra_candidates, 0, i,
  	{
  	  tree var = referenced_var (i);
  	  struct sra_elt *elt = lookup_element (NULL, var, NULL, NO_INSERT);
  	  if (elt)
  	    scan_dump (elt);
! 	});
        fputc ('\n', dump_file);
      }
  }
--- 1020,1032 ----
        size_t i;
  
        fputs ("\nScan results:\n", dump_file);
!       EXECUTE_IF_SET_IN_BITMAP (sra_candidates, 0, i, bi)
  	{
  	  tree var = referenced_var (i);
  	  struct sra_elt *elt = lookup_element (NULL, var, NULL, NO_INSERT);
  	  if (elt)
  	    scan_dump (elt);
! 	}
        fputc ('\n', dump_file);
      }
  }
*************** decide_instantiations (void)
*** 1351,1363 ****
    unsigned int i;
    bool cleared_any;
    struct bitmap_head_def done_head;
  
    /* We cannot clear bits from a bitmap we're iterating over,
       so save up all the bits to clear until the end.  */
    bitmap_initialize (&done_head, 1);
    cleared_any = false;
  
!   EXECUTE_IF_SET_IN_BITMAP (sra_candidates, 0, i,
      {
        tree var = referenced_var (i);
        struct sra_elt *elt = lookup_element (NULL, var, NULL, NO_INSERT);
--- 1352,1365 ----
    unsigned int i;
    bool cleared_any;
    struct bitmap_head_def done_head;
+   bitmap_iterator bi;
  
    /* We cannot clear bits from a bitmap we're iterating over,
       so save up all the bits to clear until the end.  */
    bitmap_initialize (&done_head, 1);
    cleared_any = false;
  
!   EXECUTE_IF_SET_IN_BITMAP (sra_candidates, 0, i, bi)
      {
        tree var = referenced_var (i);
        struct sra_elt *elt = lookup_element (NULL, var, NULL, NO_INSERT);
*************** decide_instantiations (void)
*** 1372,1378 ****
  	  bitmap_set_bit (&done_head, i);
  	  cleared_any = true;
  	}
!     });
  
    if (cleared_any)
      {
--- 1374,1380 ----
  	  bitmap_set_bit (&done_head, i);
  	  cleared_any = true;
  	}
!     }
  
    if (cleared_any)
      {
*************** scalarize_parms (void)
*** 1957,1969 ****
  {
    tree list = NULL;
    size_t i;
  
!   EXECUTE_IF_SET_IN_BITMAP (needs_copy_in, 0, i,
      {
        tree var = referenced_var (i);
        struct sra_elt *elt = lookup_element (NULL, var, NULL, NO_INSERT);
        generate_copy_inout (elt, true, var, &list);
!     });
  
    if (list)
      insert_edge_copies (list, ENTRY_BLOCK_PTR);
--- 1959,1972 ----
  {
    tree list = NULL;
    size_t i;
+   bitmap_iterator bi;
  
!   EXECUTE_IF_SET_IN_BITMAP (needs_copy_in, 0, i, bi)
      {
        tree var = referenced_var (i);
        struct sra_elt *elt = lookup_element (NULL, var, NULL, NO_INSERT);
        generate_copy_inout (elt, true, var, &list);
!     }
  
    if (list)
      insert_edge_copies (list, ENTRY_BLOCK_PTR);
Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.43
diff -c -3 -p -r2.43 tree-ssa-alias.c
*** tree-ssa-alias.c	23 Sep 2004 14:34:19 -0000	2.43
--- tree-ssa-alias.c	25 Sep 2004 22:08:41 -0000
*************** init_alias_info (void)
*** 382,391 ****
    if (aliases_computed_p)
      {
        size_t i;
  
        /* Clear the call-clobbered set.  We are going to re-discover
  	  call-clobbered variables.  */
!       EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i,
  	{
  	  tree var = referenced_var (i);
  
--- 382,392 ----
    if (aliases_computed_p)
      {
        size_t i;
+       bitmap_iterator bi;
  
        /* Clear the call-clobbered set.  We are going to re-discover
  	  call-clobbered variables.  */
!       EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, bi)
  	{
  	  tree var = referenced_var (i);
  
*************** init_alias_info (void)
*** 394,400 ****
  	     code, so we can't remove them from CALL_CLOBBERED_VARS.  */
  	  if (!is_call_clobbered (var))
  	    bitmap_clear_bit (call_clobbered_vars, var_ann (var)->uid);
! 	});
  
        /* Similarly, clear the set of addressable variables.  In this
  	 case, we can just clear the set because addressability is
--- 395,401 ----
  	     code, so we can't remove them from CALL_CLOBBERED_VARS.  */
  	  if (!is_call_clobbered (var))
  	    bitmap_clear_bit (call_clobbered_vars, var_ann (var)->uid);
! 	}
  
        /* Similarly, clear the set of addressable variables.  In this
  	 case, we can just clear the set because addressability is
*************** compute_points_to_and_addr_escape (struc
*** 589,594 ****
--- 590,596 ----
  	  bitmap addr_taken;
  	  tree stmt = bsi_stmt (si);
  	  bool stmt_escapes_p = is_escape_site (stmt, &ai->num_calls_found);
+ 	  bitmap_iterator bi;
  
  	  /* Mark all the variables whose address are taken by the
  	     statement.  Note that this will miss all the addresses taken
*************** compute_points_to_and_addr_escape (struc
*** 597,609 ****
  	  get_stmt_operands (stmt);
  	  addr_taken = addresses_taken (stmt);
  	  if (addr_taken)
! 	    EXECUTE_IF_SET_IN_BITMAP (addr_taken, 0, i,
! 		{
! 		  tree var = referenced_var (i);
! 		  bitmap_set_bit (ai->addresses_needed, var_ann (var)->uid);
! 		  if (stmt_escapes_p)
! 		    mark_call_clobbered (var);
! 		});
  
  	  if (stmt_escapes_p)
  	    block_ann->has_escape_site = 1;
--- 599,611 ----
  	  get_stmt_operands (stmt);
  	  addr_taken = addresses_taken (stmt);
  	  if (addr_taken)
! 	    EXECUTE_IF_SET_IN_BITMAP (addr_taken, 0, i, bi)
! 	      {
! 		tree var = referenced_var (i);
! 		bitmap_set_bit (ai->addresses_needed, var_ann (var)->uid);
! 		if (stmt_escapes_p)
! 		  mark_call_clobbered (var);
! 	      }
  
  	  if (stmt_escapes_p)
  	    block_ann->has_escape_site = 1;
*************** compute_points_to_and_addr_escape (struc
*** 618,628 ****
  	  if (addr_taken
  	      && TREE_CODE (stmt) == MODIFY_EXPR
  	      && !POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (stmt, 0))))
! 	    EXECUTE_IF_SET_IN_BITMAP (addr_taken, 0, i,
! 		{
! 		  tree var = referenced_var (i);
! 		  mark_call_clobbered (var);
! 		});
  
  	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
  	    {
--- 620,630 ----
  	  if (addr_taken
  	      && TREE_CODE (stmt) == MODIFY_EXPR
  	      && !POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (stmt, 0))))
! 	    EXECUTE_IF_SET_IN_BITMAP (addr_taken, 0, i, bi)
! 	      {
! 		tree var = referenced_var (i);
! 		mark_call_clobbered (var);
! 	      }
  
  	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
  	    {
*************** compute_flow_sensitive_aliasing (struct 
*** 835,840 ****
--- 837,843 ----
        tree ptr = VARRAY_TREE (ai->processed_ptrs, i);
        struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
        var_ann_t v_ann = var_ann (SSA_NAME_VAR (ptr));
+       bitmap_iterator bi;
  
        if (pi->value_escapes_p || pi->pt_anything)
  	{
*************** compute_flow_sensitive_aliasing (struct 
*** 847,862 ****
  	    mark_call_clobbered (v_ann->type_mem_tag);
  
  	  if (pi->pt_vars)
! 	    EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, j,
! 		mark_call_clobbered (referenced_var (j)));
  	}
  
        /* Set up aliasing information for PTR's name memory tag (if it has
  	 one).  Note that only pointers that have been dereferenced will
  	 have a name memory tag.  */
        if (pi->name_mem_tag && pi->pt_vars)
! 	EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, j,
! 	    add_may_alias (pi->name_mem_tag, referenced_var (j)));
  
        /* If the name tag is call clobbered, so is the type tag
  	 associated with the base VAR_DECL.  */
--- 850,869 ----
  	    mark_call_clobbered (v_ann->type_mem_tag);
  
  	  if (pi->pt_vars)
! 	    EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, j, bi)
! 	      {
! 		mark_call_clobbered (referenced_var (j));
! 	      }
  	}
  
        /* Set up aliasing information for PTR's name memory tag (if it has
  	 one).  Note that only pointers that have been dereferenced will
  	 have a name memory tag.  */
        if (pi->name_mem_tag && pi->pt_vars)
! 	EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, j, bi)
! 	  {
! 	    add_may_alias (pi->name_mem_tag, referenced_var (j));
! 	  }
  
        /* If the name tag is call clobbered, so is the type tag
  	 associated with the base VAR_DECL.  */
*************** static void
*** 1476,1488 ****
  maybe_create_global_var (struct alias_info *ai)
  {
    size_t i, n_clobbered;
    
    /* No need to create it, if we have one already.  */
    if (global_var == NULL_TREE)
      {
        /* Count all the call-clobbered variables.  */
        n_clobbered = 0;
!       EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, n_clobbered++);
  
        /* Create .GLOBAL_VAR if we have too many call-clobbered
  	 variables.  We also create .GLOBAL_VAR when there no
--- 1483,1499 ----
  maybe_create_global_var (struct alias_info *ai)
  {
    size_t i, n_clobbered;
+   bitmap_iterator bi;
    
    /* No need to create it, if we have one already.  */
    if (global_var == NULL_TREE)
      {
        /* Count all the call-clobbered variables.  */
        n_clobbered = 0;
!       EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, bi)
! 	{
! 	  n_clobbered++;
! 	}
  
        /* Create .GLOBAL_VAR if we have too many call-clobbered
  	 variables.  We also create .GLOBAL_VAR when there no
*************** maybe_create_global_var (struct alias_in
*** 1510,1516 ****
    /* If the function has calls to clobbering functions and .GLOBAL_VAR has
       been created, make it an alias for all call-clobbered variables.  */
    if (global_var)
!     EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i,
        {
  	tree var = referenced_var (i);
  	if (var != global_var)
--- 1521,1527 ----
    /* If the function has calls to clobbering functions and .GLOBAL_VAR has
       been created, make it an alias for all call-clobbered variables.  */
    if (global_var)
!     EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, bi)
        {
  	tree var = referenced_var (i);
  	if (var != global_var)
*************** maybe_create_global_var (struct alias_in
*** 1518,1524 ****
  	     add_may_alias (var, global_var);
  	     bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
  	  }
!       });
  }
  
  
--- 1529,1535 ----
  	     add_may_alias (var, global_var);
  	     bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
  	  }
!       }
  }
  
  
*************** dump_points_to_info_for (FILE *file, tre
*** 2315,2327 ****
        if (pi->pt_vars)
  	{
  	  unsigned ix;
  
  	  fprintf (file, ", points-to vars: { ");
! 	  EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, ix,
! 	      {
! 		print_generic_expr (file, referenced_var (ix), dump_flags);
! 		fprintf (file, " ");
! 	      });
  	  fprintf (file, "}");
  	}
      }
--- 2326,2339 ----
        if (pi->pt_vars)
  	{
  	  unsigned ix;
+ 	  bitmap_iterator bi;
  
  	  fprintf (file, ", points-to vars: { ");
! 	  EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, ix, bi)
! 	    {
! 	      print_generic_expr (file, referenced_var (ix), dump_flags);
! 	      fprintf (file, " ");
! 	    }
  	  fprintf (file, "}");
  	}
      }
Index: tree-ssa-dce.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dce.c,v
retrieving revision 2.19
diff -c -3 -p -r2.19 tree-ssa-dce.c
*** tree-ssa-dce.c	23 Sep 2004 14:34:19 -0000	2.19
--- tree-ssa-dce.c	25 Sep 2004 22:08:41 -0000
*************** bitmap *control_dependence_map;
*** 95,101 ****
  /* Execute CODE for each edge (given number EDGE_NUMBER within the CODE)
     for which the block with index N is control dependent.  */
  #define EXECUTE_IF_CONTROL_DEPENDENT(N, EDGE_NUMBER, CODE)		      \
!   EXECUTE_IF_SET_IN_BITMAP (control_dependence_map[N], 0, EDGE_NUMBER, CODE)
  
  /* Local function prototypes.  */
  static inline void set_control_dependence_map_bit (basic_block, int);
--- 95,108 ----
  /* Execute CODE for each edge (given number EDGE_NUMBER within the CODE)
     for which the block with index N is control dependent.  */
  #define EXECUTE_IF_CONTROL_DEPENDENT(N, EDGE_NUMBER, CODE)		      \
!   {									      \
!     bitmap_iterator bi;							      \
! 									      \
!     EXECUTE_IF_SET_IN_BITMAP (control_dependence_map[N], 0, EDGE_NUMBER, bi)  \
!       {									      \
! 	CODE;								      \
!       }									      \
!   }
  
  /* Local function prototypes.  */
  static inline void set_control_dependence_map_bit (basic_block, int);
Index: tree-ssa-dse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dse.c,v
retrieving revision 2.11
diff -c -3 -p -r2.11 tree-ssa-dse.c
*** tree-ssa-dse.c	15 Sep 2004 04:12:18 -0000	2.11
--- tree-ssa-dse.c	25 Sep 2004 22:08:41 -0000
*************** dse_finalize_block (struct dom_walk_data
*** 368,377 ****
    struct dse_global_data *dse_gd = walk_data->global_data;
    bitmap stores = dse_gd->stores;
    unsigned int i;
  
    /* Unwind the stores noted in this basic block.  */
    if (bd->stores)
!     EXECUTE_IF_SET_IN_BITMAP (bd->stores, 0, i, bitmap_clear_bit (stores, i););
  }
  
  static void
--- 368,381 ----
    struct dse_global_data *dse_gd = walk_data->global_data;
    bitmap stores = dse_gd->stores;
    unsigned int i;
+   bitmap_iterator bi;
  
    /* Unwind the stores noted in this basic block.  */
    if (bd->stores)
!     EXECUTE_IF_SET_IN_BITMAP (bd->stores, 0, i, bi)
!       {
! 	bitmap_clear_bit (stores, i);
!       }
  }
  
  static void
Index: tree-ssa-live.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-live.c,v
retrieving revision 2.20
diff -c -3 -p -r2.20 tree-ssa-live.c
*** tree-ssa-live.c	17 Sep 2004 21:54:42 -0000	2.20
--- tree-ssa-live.c	25 Sep 2004 22:08:41 -0000
*************** live_worklist (tree_live_info_p live, va
*** 488,502 ****
    basic_block def_bb = NULL;
    edge e;
    var_map map = live->map;
  
    var = partition_to_var (map, i);
    if (SSA_NAME_DEF_STMT (var))
      def_bb = bb_for_stmt (SSA_NAME_DEF_STMT (var));
  
!   EXECUTE_IF_SET_IN_BITMAP (live->livein[i], 0, b,
      {
        VARRAY_PUSH_INT (stack, b);
!     });
  
    while (VARRAY_ACTIVE_SIZE (stack) > 0)
      {
--- 488,503 ----
    basic_block def_bb = NULL;
    edge e;
    var_map map = live->map;
+   bitmap_iterator bi;
  
    var = partition_to_var (map, i);
    if (SSA_NAME_DEF_STMT (var))
      def_bb = bb_for_stmt (SSA_NAME_DEF_STMT (var));
  
!   EXECUTE_IF_SET_IN_BITMAP (live->livein[i], 0, b, bi)
      {
        VARRAY_PUSH_INT (stack, b);
!     }
  
    while (VARRAY_ACTIVE_SIZE (stack) > 0)
      {
*************** calculate_live_on_entry (var_map map)
*** 565,570 ****
--- 566,572 ----
    block_stmt_iterator bsi;
    stmt_ann_t ann;
    ssa_op_iter iter;
+   bitmap_iterator bi;
  #ifdef ENABLE_CHECKING
    int num;
  #endif
*************** calculate_live_on_entry (var_map map)
*** 628,637 ****
      }
  
    VARRAY_INT_INIT (stack, last_basic_block, "stack");
!   EXECUTE_IF_SET_IN_BITMAP (live->global, 0, i,
      {
        live_worklist (live, stack, i);
!     });
  
  #ifdef ENABLE_CHECKING
     /* Check for live on entry partitions and report those with a DEF in
--- 630,639 ----
      }
  
    VARRAY_INT_INIT (stack, last_basic_block, "stack");
!   EXECUTE_IF_SET_IN_BITMAP (live->global, 0, i, bi)
      {
        live_worklist (live, stack, i);
!     }
  
  #ifdef ENABLE_CHECKING
     /* Check for live on entry partitions and report those with a DEF in
*************** calculate_live_on_exit (tree_live_info_p
*** 758,770 ****
    /* Set live on exit for all predecessors of live on entry's.  */
    for (i = 0; i < num_var_partitions (map); i++)
      {
        on_entry = live_entry_blocks (liveinfo, i);
!       EXECUTE_IF_SET_IN_BITMAP (on_entry, 0, b,
          {
  	  for (e = BASIC_BLOCK(b)->pred; e; e = e->pred_next)
  	    if (e->src != ENTRY_BLOCK_PTR)
  	      bitmap_set_bit (on_exit[e->src->index], i);
! 	});
      }
  
    liveinfo->liveout = on_exit;
--- 760,774 ----
    /* Set live on exit for all predecessors of live on entry's.  */
    for (i = 0; i < num_var_partitions (map); i++)
      {
+       bitmap_iterator bi;
+ 
        on_entry = live_entry_blocks (liveinfo, i);
!       EXECUTE_IF_SET_IN_BITMAP (on_entry, 0, b, bi)
          {
  	  for (e = BASIC_BLOCK(b)->pred; e; e = e->pred_next)
  	    if (e->src != ENTRY_BLOCK_PTR)
  	      bitmap_set_bit (on_exit[e->src->index], i);
! 	}
      }
  
    liveinfo->liveout = on_exit;
*************** build_tree_conflict_graph (tree_live_inf
*** 1295,1300 ****
--- 1299,1305 ----
    varray_type partition_link, tpa_to_clear, tpa_nodes;
    unsigned l;
    ssa_op_iter iter;
+   bitmap_iterator bi;
  
    map = live_var_map (liveinfo);
    graph = conflict_graph_new (num_var_partitions (map));
*************** build_tree_conflict_graph (tree_live_inf
*** 1411,1417 ****
  	 tpa_clear contains all the tpa_roots processed, and these are the only
  	 entries which need to be zero'd out for a clean restart.  */
  
!       EXECUTE_IF_SET_IN_BITMAP (live, 0, x,
          {
  	  i = tpa_find_tree (tpa, x);
  	  if (i != TPA_NONE)
--- 1416,1422 ----
  	 tpa_clear contains all the tpa_roots processed, and these are the only
  	 entries which need to be zero'd out for a clean restart.  */
  
!       EXECUTE_IF_SET_IN_BITMAP (live, 0, x, bi)
          {
  	  i = tpa_find_tree (tpa, x);
  	  if (i != TPA_NONE)
*************** build_tree_conflict_graph (tree_live_inf
*** 1428,1434 ****
  	      VARRAY_INT (tpa_nodes, i) = x + 1;
  	      VARRAY_INT (partition_link, x + 1) = start;
  	    }
! 	});
  
  	/* Now clear the used tpa root references.  */
  	for (l = 0; l < VARRAY_ACTIVE_SIZE (tpa_to_clear); l++)
--- 1433,1439 ----
  	      VARRAY_INT (tpa_nodes, i) = x + 1;
  	      VARRAY_INT (partition_link, x + 1) = start;
  	    }
! 	}
  
  	/* Now clear the used tpa root references.  */
  	for (l = 0; l < VARRAY_ACTIVE_SIZE (tpa_to_clear); l++)
*************** dump_live_info (FILE *f, tree_live_info_
*** 1745,1750 ****
--- 1750,1756 ----
    basic_block bb;
    int i;
    var_map map = live->map;
+   bitmap_iterator bi;
  
    if ((flag & LIVEDUMP_ENTRY) && live->livein)
      {
*************** dump_live_info (FILE *f, tree_live_info_
*** 1768,1778 ****
        FOR_EACH_BB (bb)
  	{
  	  fprintf (f, "\nLive on exit from BB%d : ", bb->index);
! 	  EXECUTE_IF_SET_IN_BITMAP (live->liveout[bb->index], 0, i,
  	    {
  	      print_generic_expr (f, partition_to_var (map, i), TDF_SLIM);
  	      fprintf (f, "  ");
! 	    });
  	  fprintf (f, "\n");
  	}
      }
--- 1774,1784 ----
        FOR_EACH_BB (bb)
  	{
  	  fprintf (f, "\nLive on exit from BB%d : ", bb->index);
! 	  EXECUTE_IF_SET_IN_BITMAP (live->liveout[bb->index], 0, i, bi)
  	    {
  	      print_generic_expr (f, partition_to_var (map, i), TDF_SLIM);
  	      fprintf (f, "  ");
! 	    }
  	  fprintf (f, "\n");
  	}
      }
Index: tree-ssa-loop-ivopts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ivopts.c,v
retrieving revision 2.12
diff -c -3 -p -r2.12 tree-ssa-loop-ivopts.c
*** tree-ssa-loop-ivopts.c	23 Sep 2004 14:34:19 -0000	2.12
--- tree-ssa-loop-ivopts.c	25 Sep 2004 22:08:41 -0000
*************** find_induction_variables (struct ivopts_
*** 925,930 ****
--- 925,931 ----
  {
    unsigned i;
    struct loop *loop = data->current_loop;
+   bitmap_iterator bi;
  
    if (!find_bivs (data))
      return false;
*************** find_induction_variables (struct ivopts_
*** 956,966 ****
   
        fprintf (dump_file, "Induction variables:\n\n");
  
!       EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, i,
  	{
  	  if (ver_info (data, i)->iv)
  	    dump_iv (dump_file, ver_info (data, i)->iv);
! 	});
      }
  
    return true;
--- 957,967 ----
   
        fprintf (dump_file, "Induction variables:\n\n");
  
!       EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, i, bi)
  	{
  	  if (ver_info (data, i)->iv)
  	    dump_iv (dump_file, ver_info (data, i)->iv);
! 	}
      }
  
    return true;
*************** find_interesting_uses (struct ivopts_dat
*** 1463,1471 ****
  
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "\n");
  
!       EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, i,
  	{
  	  info = ver_info (data, i);
  	  if (info->inv_id)
--- 1464,1474 ----
  
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
+       bitmap_iterator bi;
+ 
        fprintf (dump_file, "\n");
  
!       EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, i, bi)
  	{
  	  info = ver_info (data, i);
  	  if (info->inv_id)
*************** find_interesting_uses (struct ivopts_dat
*** 1475,1481 ****
  	      fprintf (dump_file, " is invariant (%d)%s\n",
  		       info->inv_id, info->has_nonlin_use ? "" : ", eliminable");
  	    }
! 	});
  
        fprintf (dump_file, "\n");
      }
--- 1478,1484 ----
  	      fprintf (dump_file, " is invariant (%d)%s\n",
  		       info->inv_id, info->has_nonlin_use ? "" : ", eliminable");
  	    }
! 	}
  
        fprintf (dump_file, "\n");
      }
*************** add_old_ivs_candidates (struct ivopts_da
*** 1657,1669 ****
  {
    unsigned i;
    struct iv *iv;
  
!   EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, i,
      {
        iv = ver_info (data, i)->iv;
        if (iv && iv->biv_p && !zero_p (iv->step))
  	add_old_iv_candidates (data, iv);
!     });
  }
  
  /* Adds candidates based on the value of the induction variable IV and USE.  */
--- 1660,1673 ----
  {
    unsigned i;
    struct iv *iv;
+   bitmap_iterator bi;
  
!   EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, i, bi)
      {
        iv = ver_info (data, i)->iv;
        if (iv && iv->biv_p && !zero_p (iv->step))
  	add_old_iv_candidates (data, iv);
!     }
  }
  
  /* Adds candidates based on the value of the induction variable IV and USE.  */
*************** alloc_use_cost_map (struct ivopts_data *
*** 1834,1839 ****
--- 1838,1844 ----
    for (i = 0; i < n_iv_uses (data); i++)
      {
        struct iv_use *use = iv_use (data, i);
+       bitmap_iterator bi;
  
        if (data->consider_all_candidates)
  	{
*************** alloc_use_cost_map (struct ivopts_data *
*** 1843,1849 ****
        else
  	{
  	  size = n_imp;
! 	  EXECUTE_IF_SET_IN_BITMAP (use->related_cands, 0, j, size++);
  	  use->n_map_members = 0;
  	}
  
--- 1848,1857 ----
        else
  	{
  	  size = n_imp;
! 	  EXECUTE_IF_SET_IN_BITMAP (use->related_cands, 0, j, bi)
! 	    {
! 	      size++;
! 	    }
  	  use->n_map_members = 0;
  	}
  
*************** determine_use_iv_costs (struct ivopts_da
*** 3142,3153 ****
  	}
        else
  	{
! 	  EXECUTE_IF_SET_IN_BITMAP (use->related_cands, 0, j,
  	    {
  	      cand = iv_cand (data, j);
  	      if (!cand->important)
  	        determine_use_iv_cost (data, use, cand);
! 	    });
  	}
      }
  
--- 3150,3163 ----
  	}
        else
  	{
! 	  bitmap_iterator bi;
! 
! 	  EXECUTE_IF_SET_IN_BITMAP (use->related_cands, 0, j, bi)
  	    {
  	      cand = iv_cand (data, j);
  	      if (!cand->important)
  	        determine_use_iv_cost (data, use, cand);
! 	    }
  	}
      }
  
*************** determine_set_costs (struct ivopts_data 
*** 3269,3274 ****
--- 3279,3285 ----
    unsigned j, n;
    tree phi, op;
    struct loop *loop = data->current_loop;
+   bitmap_iterator bi;
  
    /* We use the following model (definitely improvable, especially the
       cost function -- TODO):
*************** determine_set_costs (struct ivopts_data 
*** 3313,3325 ****
        n++;
      }
  
!   EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, j,
      {
        struct version_info *info = ver_info (data, j);
  
        if (info->inv_id && info->has_nonlin_use)
  	n++;
!     });
  
    loop_data (loop)->regs_used = n;
    if (dump_file && (dump_flags & TDF_DETAILS))
--- 3324,3336 ----
        n++;
      }
  
!   EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, j, bi)
      {
        struct version_info *info = ver_info (data, j);
  
        if (info->inv_id && info->has_nonlin_use)
  	n++;
!     }
  
    loop_data (loop)->regs_used = n;
    if (dump_file && (dump_flags & TDF_DETAILS))
*************** find_best_candidate (struct ivopts_data 
*** 3350,3355 ****
--- 3361,3367 ----
    unsigned best_cost = INFTY, cost;
    struct iv_cand *cnd = NULL, *acnd;
    bitmap depends_on = NULL, asol;
+   bitmap_iterator bi, bi1;
  
    if (data->consider_all_candidates)
      asol = sol;
*************** find_best_candidate (struct ivopts_data 
*** 3359,3392 ****
        bitmap_a_and_b (asol, sol, use->related_cands);
      }
  
!   EXECUTE_IF_SET_IN_BITMAP (asol, 0, c,
      {
        acnd = iv_cand (data, c);
        cost = get_use_iv_cost (data, use, acnd, &depends_on);
  
        if (cost == INFTY)
! 	goto next_cand;
        if (cost > best_cost)
! 	goto next_cand;
        if (cost == best_cost)
  	{
  	  /* Prefer the cheaper iv.  */
  	  if (acnd->cost >= cnd->cost)
! 	    goto next_cand;
  	}
  
        if (depends_on)
  	{
! 	  EXECUTE_IF_AND_COMPL_IN_BITMAP (depends_on, inv, 0, d,
! 					  goto next_cand);
  	  if (used_inv)
  	    bitmap_a_or_b (used_inv, used_inv, depends_on);
  	}
  
        cnd = acnd;
        best_cost = cost;
  next_cand: ;
!     });
  
    if (cnd && used_ivs)
      bitmap_set_bit (used_ivs, cnd->id);
--- 3371,3407 ----
        bitmap_a_and_b (asol, sol, use->related_cands);
      }
  
!   EXECUTE_IF_SET_IN_BITMAP (asol, 0, c, bi)
      {
        acnd = iv_cand (data, c);
        cost = get_use_iv_cost (data, use, acnd, &depends_on);
  
        if (cost == INFTY)
! 	continue;
        if (cost > best_cost)
! 	continue;
        if (cost == best_cost)
  	{
  	  /* Prefer the cheaper iv.  */
  	  if (acnd->cost >= cnd->cost)
! 	    continue;
  	}
  
        if (depends_on)
  	{
! 	  EXECUTE_IF_AND_COMPL_IN_BITMAP (depends_on, inv, 0, d, bi1)
! 	    {
! 	      goto next_cand;
! 	    }
  	  if (used_inv)
  	    bitmap_a_or_b (used_inv, used_inv, depends_on);
  	}
  
        cnd = acnd;
        best_cost = cost;
+ 
  next_cand: ;
!     }
  
    if (cnd && used_ivs)
      bitmap_set_bit (used_ivs, cnd->id);
*************** set_cost_up_to (struct ivopts_data *data
*** 3413,3418 ****
--- 3428,3434 ----
    struct iv_use *use;
    struct iv_cand *cand;
    bitmap used_ivs = BITMAP_XMALLOC (), used_inv = BITMAP_XMALLOC ();
+   bitmap_iterator bi;
  
    for (i = 0; i < max_use; i++)
      {
*************** set_cost_up_to (struct ivopts_data *data
*** 3428,3434 ****
        cost += acost;
      }
  
!   EXECUTE_IF_SET_IN_BITMAP (used_ivs, 0, i,
      {
        cand = iv_cand (data, i);
  
--- 3444,3450 ----
        cost += acost;
      }
  
!   EXECUTE_IF_SET_IN_BITMAP (used_ivs, 0, i, bi)
      {
        cand = iv_cand (data, i);
  
*************** set_cost_up_to (struct ivopts_data *data
*** 3437,3444 ****
  	size++;
  
        cost += cand->cost;
!     });
!   EXECUTE_IF_SET_IN_BITMAP (used_inv, 0, i, size++);
    cost += ivopts_global_cost_for_size (data, size);
  
    bitmap_copy (sol, used_ivs);
--- 3453,3463 ----
  	size++;
  
        cost += cand->cost;
!     }
!   EXECUTE_IF_SET_IN_BITMAP (used_inv, 0, i, bi)
!     {
!       size++;
!     }
    cost += ivopts_global_cost_for_size (data, size);
  
    bitmap_copy (sol, used_ivs);
*************** create_new_ivs (struct ivopts_data *data
*** 3712,3723 ****
  {
    unsigned i;
    struct iv_cand *cand;
  
!   EXECUTE_IF_SET_IN_BITMAP (set, 0, i,
      {
        cand = iv_cand (data, i);
        create_new_iv (data, cand);
!     });
  }
  
  /* Removes statement STMT (real or a phi node).  If INCLUDING_DEFINED_NAME
--- 3731,3743 ----
  {
    unsigned i;
    struct iv_cand *cand;
+   bitmap_iterator bi;
  
!   EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi)
      {
        cand = iv_cand (data, i);
        create_new_iv (data, cand);
!     }
  }
  
  /* Removes statement STMT (real or a phi node).  If INCLUDING_DEFINED_NAME
*************** static void
*** 4196,4203 ****
  remove_unused_ivs (struct ivopts_data *data)
  {
    unsigned j;
  
!   EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, j,
      {
        struct version_info *info;
  
--- 4216,4224 ----
  remove_unused_ivs (struct ivopts_data *data)
  {
    unsigned j;
+   bitmap_iterator bi;
  
!   EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, j, bi)
      {
        struct version_info *info;
  
*************** remove_unused_ivs (struct ivopts_data *d
*** 4208,4214 ****
  	  && !info->iv->have_use_for
  	  && !info->preserve_biv)
  	remove_statement (SSA_NAME_DEF_STMT (info->iv->ssa_name), true);
!     });
  }
  
  /* Frees data allocated by the optimization of a single loop.  */
--- 4229,4235 ----
  	  && !info->iv->have_use_for
  	  && !info->preserve_biv)
  	remove_statement (SSA_NAME_DEF_STMT (info->iv->ssa_name), true);
!     }
  }
  
  /* Frees data allocated by the optimization of a single loop.  */
*************** static void
*** 4217,4224 ****
  free_loop_data (struct ivopts_data *data)
  {
    unsigned i, j;
  
!   EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, i,
      {
        struct version_info *info;
  
--- 4238,4246 ----
  free_loop_data (struct ivopts_data *data)
  {
    unsigned i, j;
+   bitmap_iterator bi;
  
!   EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, i, bi)
      {
        struct version_info *info;
  
*************** free_loop_data (struct ivopts_data *data
*** 4229,4235 ****
        info->has_nonlin_use = false;
        info->preserve_biv = false;
        info->inv_id = 0;
!     });
    bitmap_clear (data->relevant);
  
    for (i = 0; i < n_iv_uses (data); i++)
--- 4251,4257 ----
        info->has_nonlin_use = false;
        info->preserve_biv = false;
        info->inv_id = 0;
!     }
    bitmap_clear (data->relevant);
  
    for (i = 0; i < n_iv_uses (data); i++)
Index: tree-ssa-loop-manip.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-manip.c,v
retrieving revision 2.7
diff -c -3 -p -r2.7 tree-ssa-loop-manip.c
*** tree-ssa-loop-manip.c	23 Sep 2004 12:21:18 -0000	2.7
--- tree-ssa-loop-manip.c	25 Sep 2004 22:08:41 -0000
*************** add_exit_phis_var (tree var, bitmap live
*** 153,158 ****
--- 153,159 ----
    bitmap def;
    int index;
    basic_block def_bb = bb_for_stmt (SSA_NAME_DEF_STMT (var));
+   bitmap_iterator bi;
  
    bitmap_clear_bit (livein, def_bb->index);
  
*************** add_exit_phis_var (tree var, bitmap live
*** 161,168 ****
    compute_global_livein (livein, def);
    BITMAP_XFREE (def);
  
!   EXECUTE_IF_AND_IN_BITMAP (exits, livein, 0, index,
! 			    add_exit_phis_edge (BASIC_BLOCK (index), var));
  }
  
  /* Add exit phis for the names marked in NAMES_TO_RENAME.
--- 162,171 ----
    compute_global_livein (livein, def);
    BITMAP_XFREE (def);
  
!   EXECUTE_IF_AND_IN_BITMAP (exits, livein, 0, index, bi)
!     {
!       add_exit_phis_edge (BASIC_BLOCK (index), var);
!     }
  }
  
  /* Add exit phis for the names marked in NAMES_TO_RENAME.
*************** static void
*** 173,183 ****
  add_exit_phis (bitmap names_to_rename, bitmap *use_blocks, bitmap loop_exits)
  {
    unsigned i;
  
!   EXECUTE_IF_SET_IN_BITMAP (names_to_rename, 0, i,
      {
        add_exit_phis_var (ssa_name (i), use_blocks[i], loop_exits);
!     });
  }
  
  /* Returns a bitmap of all loop exit edge targets.  */
--- 176,187 ----
  add_exit_phis (bitmap names_to_rename, bitmap *use_blocks, bitmap loop_exits)
  {
    unsigned i;
+   bitmap_iterator bi;
  
!   EXECUTE_IF_SET_IN_BITMAP (names_to_rename, 0, i, bi)
      {
        add_exit_phis_var (ssa_name (i), use_blocks[i], loop_exits);
!     }
  }
  
  /* Returns a bitmap of all loop exit edge targets.  */
Index: tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.c,v
retrieving revision 2.47
diff -c -3 -p -r2.47 tree-ssa-operands.c
*** tree-ssa-operands.c	23 Sep 2004 14:34:19 -0000	2.47
--- tree-ssa-operands.c	25 Sep 2004 22:08:41 -0000
*************** get_asm_expr_operands (tree stmt)
*** 1264,1287 ****
      if (strcmp (TREE_STRING_POINTER (TREE_VALUE (link)), "memory") == 0)
        {
  	size_t i;
  
  	/* Clobber all call-clobbered variables (or .GLOBAL_VAR if we
  	   decided to group them).  */
  	if (global_var)
  	  add_stmt_operand (&global_var, stmt, opf_is_def);
  	else
! 	  EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i,
  	      {
  		tree var = referenced_var (i);
  		add_stmt_operand (&var, stmt, opf_is_def);
! 	      });
  
  	/* Now clobber all addressables.  */
! 	EXECUTE_IF_SET_IN_BITMAP (addressable_vars, 0, i,
  	    {
  	      tree var = referenced_var (i);
  	      add_stmt_operand (&var, stmt, opf_is_def);
! 	    });
  
  	break;
        }
--- 1264,1288 ----
      if (strcmp (TREE_STRING_POINTER (TREE_VALUE (link)), "memory") == 0)
        {
  	size_t i;
+ 	bitmap_iterator bi;
  
  	/* Clobber all call-clobbered variables (or .GLOBAL_VAR if we
  	   decided to group them).  */
  	if (global_var)
  	  add_stmt_operand (&global_var, stmt, opf_is_def);
  	else
! 	  EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, bi)
  	      {
  		tree var = referenced_var (i);
  		add_stmt_operand (&var, stmt, opf_is_def);
! 	      }
  
  	/* Now clobber all addressables.  */
! 	EXECUTE_IF_SET_IN_BITMAP (addressable_vars, 0, i, bi)
  	    {
  	      tree var = referenced_var (i);
  	      add_stmt_operand (&var, stmt, opf_is_def);
! 	    }
  
  	break;
        }
*************** add_call_clobber_ops (tree stmt, tree ca
*** 1597,1602 ****
--- 1598,1604 ----
      {
        size_t i;
        bitmap not_read_b = NULL, not_written_b = NULL;
+       bitmap_iterator bi;
  
        /* Get info for module level statics.  There is a bit set for
  	 each static if the call being processed does not read or
*************** add_call_clobber_ops (tree stmt, tree ca
*** 1609,1615 ****
  	  not_written_b = get_global_statics_not_written (callee);
  	}
  
!       EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i,
  	{
  	  tree var = referenced_var (i);
  
--- 1611,1617 ----
  	  not_written_b = get_global_statics_not_written (callee);
  	}
  
!       EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, bi)
  	{
  	  tree var = referenced_var (i);
  
*************** add_call_clobber_ops (tree stmt, tree ca
*** 1648,1654 ****
  	      else
  		add_stmt_operand (&var, stmt, opf_is_def);
  	    }
! 	});
      }
  }
  
--- 1650,1656 ----
  	      else
  		add_stmt_operand (&var, stmt, opf_is_def);
  	    }
! 	}
      }
  }
  
*************** add_call_clobber_ops (tree stmt, tree ca
*** 1659,1664 ****
--- 1661,1668 ----
  static void
  add_call_read_ops (tree stmt, tree callee)
  {
+   bitmap_iterator bi;
+ 
    /* Otherwise, if the function is not pure, it may reference memory.  Add
       a VUSE for .GLOBAL_VAR if it has been created.  Otherwise, add a VUSE
       for each call-clobbered variable.  See add_referenced_var for the
*************** add_call_read_ops (tree stmt, tree calle
*** 1671,1684 ****
        bitmap not_read_b = callee 
  	? get_global_statics_not_read (callee) : NULL; 
  
!       EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i,
  	{
  	  tree var = referenced_var (i);
  	  bool not_read = not_read_b 
  	    ? bitmap_bit_p(not_read_b, i) : false;
  	  if (!not_read)
  	  add_stmt_operand (&var, stmt, opf_none);
! 	});
      }
  }
  
--- 1675,1688 ----
        bitmap not_read_b = callee 
  	? get_global_statics_not_read (callee) : NULL; 
  
!       EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, bi)
  	{
  	  tree var = referenced_var (i);
  	  bool not_read = not_read_b 
  	    ? bitmap_bit_p(not_read_b, i) : false;
  	  if (!not_read)
  	  add_stmt_operand (&var, stmt, opf_none);
! 	}
      }
  }
  
Index: tree-ssa-pre.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-pre.c,v
retrieving revision 2.41
diff -c -3 -p -r2.41 tree-ssa-pre.c
*** tree-ssa-pre.c	25 Sep 2004 14:36:40 -0000	2.41
--- tree-ssa-pre.c	25 Sep 2004 22:08:41 -0000
*************** bitmap_print_value_set (FILE *outfile, b
*** 769,784 ****
    if (set)
      {
        int i;
!       EXECUTE_IF_SET_IN_BITMAP (set->expressions, 0, i,
!       {
! 	print_generic_expr (outfile, ssa_name (i), 0);
  	
! 	fprintf (outfile, " (");
! 	print_generic_expr (outfile, get_value_handle (ssa_name (i)), 0);
! 	fprintf (outfile, ") ");
! 	if (bitmap_last_set_bit (set->expressions) != i)
! 	  fprintf (outfile, ", ");
!       });
      }
    fprintf (outfile, " }\n");
  }
--- 769,786 ----
    if (set)
      {
        int i;
!       bitmap_iterator bi;
! 
!       EXECUTE_IF_SET_IN_BITMAP (set->expressions, 0, i, bi)
! 	{
! 	  print_generic_expr (outfile, ssa_name (i), 0);
  	
! 	  fprintf (outfile, " (");
! 	  print_generic_expr (outfile, get_value_handle (ssa_name (i)), 0);
! 	  fprintf (outfile, ") ");
! 	  if (bitmap_last_set_bit (set->expressions) != i)
! 	    fprintf (outfile, ", ");
! 	}
      }
    fprintf (outfile, " }\n");
  }
*************** insert_aux (basic_block block)
*** 1416,1427 ****
        if (dom)
  	{
  	  int i;
  	  bitmap_set_t newset = NEW_SETS (dom);
! 	  EXECUTE_IF_SET_IN_BITMAP (newset->expressions, 0, i,
!           {
! 	    bitmap_insert_into_set (NEW_SETS (block), ssa_name (i));
! 	    bitmap_value_replace_in_set (AVAIL_OUT (block), ssa_name (i));
! 	  });
  	  if (block->pred->pred_next)
  	    {
  	      value_set_node_t node;
--- 1418,1431 ----
        if (dom)
  	{
  	  int i;
+ 	  bitmap_iterator bi;
+ 
  	  bitmap_set_t newset = NEW_SETS (dom);
! 	  EXECUTE_IF_SET_IN_BITMAP (newset->expressions, 0, i, bi)
! 	    {
! 	      bitmap_insert_into_set (NEW_SETS (block), ssa_name (i));
! 	      bitmap_value_replace_in_set (AVAIL_OUT (block), ssa_name (i));
! 	    }
  	  if (block->pred->pred_next)
  	    {
  	      value_set_node_t node;



More information about the Gcc-patches mailing list