SSA operand iterator

Andrew MacLeod amacleod@redhat.com
Tue Aug 24 15:16:00 GMT 2004



Zdenek proposed a couple of iterator patches a while back, but there
were minor problems with them. I've been thinking about it a bit, and
have come up with the following patch which makes use of his ideas. I've
posted it in 2 chunks, the first one is the really relevant one, it
implements the iterators. The second one is simply replacing most uses
of the _optype loops with the new iterator. 

This is implemented as a macro, but its a macro for just a loop header,
meaning that the body of the loop isnt part of the macro, so debugging
works fine with it, and there is no code duplication as in previous
implementations.

The iterator structure is a general purpose object which contains lots
of variables used to control the loops. We fully scalarize the
structure, and optimize out the unused portions, resulting in pretty
decent code for the loop.

This implementation has insignificant cost. It occasionally wins
(probably due to the reduction in code duplication, reducing register
pressure), and ocassionally loses,  My guess is that since there is no
code duplication now, we end up producing less register pressure in some
routines and thus end up with a slight win. In any case, There is no
noticable penalty for using it, which was a strike against the earlier
versions.

I'll provide a quick synopsis of how the new iterator works, and you can
let me know if there is something that should maybe be changed. 

There are basically 3 types of iterator loops. 
Loops which work with use_operand_p, def_operand_p and trees. 
Actually, there is a 4th type of loop, one that loops at just MAYDEFs...
this is unique in that they have both a use and a def associated with
them. 

Each iteraotr loop takes 4 parameters:
  - The variable each iteration is assigned into
  - The stmt which is being looked at
  - An iterator structure which is used to control the loop
  - Flags indicating which operands to look at.


So a typical translation from the previous method to the current looks
something like :

      stmt_ann_t ann = get_stmt_ann (old);
      use_optype uses = USE_OPS (ann);
      vuse_optype vuses = VUSE_OPS (ann);
      v_may_def_optype v_may_defs = V_MAY_DEF_OPS (ann);
      unsigned int i;
    
      /* Look at USE_OPS or VUSE_OPS according to FLAGS.  */
      for (i = 0; i < NUM_USES (uses); i++)
        redirect_immediate_use (USE_OP (uses, i), old, new);
    
      for (i = 0; i < NUM_VUSES (vuses); i++)
        redirect_immediate_use (VUSE_OP (vuses, i), old, new);
    
      for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
        redirect_immediate_use (V_MAY_DEF_OP (v_may_defs, i), old, new);
    
Can be rewritten as :

      ssa_op_iter iter;
      tree val;
    
      FOR_EACH_SSA_TREE_OPERAND (val, old, iter, SSA_OP_ALL_USES)
        redirect_immediate_use (val, old, new);
    

Of the other 3 types of loops, here are examples of each:

      ssa_op_iter iter;
      use_operand_p use_p;
      
      FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
          {
            if (prepare_use_operand_for_rename (use_p, &uid)
              && !TEST_BIT (kills, uid))
            set_livein_block (USE_FROM_PTR (use_p), bb);
          }
    
      ssa_op_iter iter;
      def_operand_p def_p;
    
      FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_ALL_DEFS)
          {
            if (TREE_CODE (DEF_FROM_PTR (def_p)) != SSA_NAME)
            SET_DEF (def_p, make_ssa_name (DEF_FROM_PTR (def_p), stmt));
          }
    
    
      FOR_EACH_SSA_MAYDEF_OPERAND (def_p, use_p, stmt, iter)
          {
            if (prepare_use_operand_for_rename (use_p, &uid))
            {
              /* If we do not already have an SSA_NAME for our destination,
                 then set the destination to the source.  */
              if (TREE_CODE (DEF_FROM_PTR (def_p)) != SSA_NAME)
                SET_DEF (def_p, USE_FROM_PTR (use_p));
    
                set_livein_block (USE_FROM_PTR (use_p), bb);
              set_def_block (DEF_FROM_PTR (def_p), bb, false, false);
            }
          }
    
    
So thats what it looks like. The first patch implements the iterator,
and has the flags and such. The second one is all the changes required
to the rest of the compiler to replace the operand loops with this
general iterator. I replaced almost all them, even the ones which only
loop over a single operand type.

Anyone have any issues with this? Wanna see something changed? Does it
accomplish what you are looking for? I'll check it in if its sufficient.

It bootstraps on i686-pc-linux-gnu and produces no new testsuite
failures.

Andrew


2004-08-24  Andrew MacLeod  <amacleod@redhat.com>

	* tree-ssa-operands.h (struct ssa_operand_iterator_d): New.  SSA operand
	iterator controlling structure.
	(SSA_OP_USE, SSA_OP_DEF, SSA_OP_VUSE, SSA_OP_VMAYUSE, SSA_OP_VMAYDEF,
	SSA_OP_VMUSTDEF, SSA_OP_VIRTUAL_USES, SSA_OP_VIRTUAL_DEFS,
	SSA_OP_ALL_USES, SSA_OP_ALL_DEFS, SSA_OP_ALL_OPERANDS): New.  Operand
	iterator flags.
	(FOR_EACH_SSA_TREE_OPERAND): New.  Iterate over operands as trees.
	(FOR_EACH_SSA_USE_OPERAND): New.  Iterate over operands as uses.
	(FOR_EACH_SSA_DEF_OPERAND): New.  Iterate over operands as defs.
	(FOR_EACH_SSA_MAYDEF_OPERAND): New.  Iterate over V_MAY_DEFs.
	* tree-ssa-operands.c (NULL_DEF_OPERAND_P, NULL_USE_OPERAND_P): New. 
	Empty operand pointers.
	* tree-flow-inline.h (op_iter_done): New.  Return true if finished.
	(op_iter_next_use): New.  Return next use_operand_p.
	(op_iter_next_def): New.  Return next def_operand_p.
	(op_iter_next_tree): New.  Return next operands as a tree.
	(op_iter_init): New.  Initialize an iterator structure.
	(op_iter_init_use): New.  Initialize structure and get the first use.
	(op_iter_init_def): New.  Initialize structure and get the first def.
	(op_iter_init_tree): New.  Initialize structure and get the first tree.
	(op_iter_next_maydef): New.  Return next V_MAY_DEF operands.
	(op_iter_init_maydef): New.  Initialize structure and get the first 
	V_MAY_DEF operands.



Index: tree-ssa-operands.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.h,v
retrieving revision 2.5
diff -c -p -r2.5 tree-ssa-operands.h
*** tree-ssa-operands.h	11 Aug 2004 17:50:47 -0000	2.5
--- tree-ssa-operands.h	24 Aug 2004 14:29:49 -0000
*************** typedef struct use_operand_ptr GTY(())
*** 36,41 ****
--- 36,43 ----
    tree * GTY((skip(""))) use;
  } use_operand_p;
  
+ extern def_operand_p NULL_DEF_OPERAND_P;
+ extern use_operand_p NULL_USE_OPERAND_P;
  
  /* This represents the DEF operands of a stmt.  */
  typedef struct def_optype_d GTY(())
*************** extern void get_stmt_operands (tree);
*** 184,187 ****
--- 186,261 ----
  extern void copy_virtual_operands (tree, tree);
  extern void create_ssa_artficial_load_stmt (stmt_operands_p, tree);
  
+ 
+ /* This structure is used in the operand iterator loops.  It contains the 
+    items required to determine which operand is retreived next.  During
+    optimization, this structure is scalarized, and any unused fields are 
+    optimized away, resulting in little overhead.  */
+ 
+ typedef struct ssa_operand_iterator_d
+ {
+   int num_use;
+   int num_def;
+   int num_vuse;
+   int num_v_mayu;
+   int num_v_mayd;
+   int num_v_must;
+   int use_i;
+   int def_i;
+   int vuse_i;
+   int v_mayu_i;
+   int v_mayd_i;
+   int v_must_i;
+   stmt_operands_p ops;
+   bool done;
+ } ssa_op_iter;
+ 
+ /* These flags are used to determine which operands are returned during 
+    execution of the loop.  */
+ #define SSA_OP_USE		0x01	/* Real USE operands.  */
+ #define SSA_OP_DEF		0x02	/* Real DEF operands.  */
+ #define SSA_OP_VUSE		0x04	/* VUSE operands.  */
+ #define SSA_OP_VMAYUSE		0x08	/* USE portion of V_MAY_DEFS.  */
+ #define SSA_OP_VMAYDEF		0x10	/* DEF portion of V_MAY_DEFS.  */
+ #define SSA_OP_VMUSTDEF		0x20	/* V_MUST_DEF defintions.  */
+ 
+ /* These are commonly grouped operand flags.  */
+ #define SSA_OP_VIRTUAL_USES	(SSA_OP_VUSE | SSA_OP_VMAYUSE)
+ #define SSA_OP_VIRTUAL_DEFS	(SSA_OP_VMAYDEF | SSA_OP_VMUSTDEF)
+ #define SSA_OP_ALL_USES		(SSA_OP_VIRTUAL_USES | SSA_OP_USE)
+ #define SSA_OP_ALL_DEFS		(SSA_OP_VIRTUAL_DEFS | SSA_OP_DEF)
+ #define SSA_OP_ALL_OPERANDS	(SSA_OP_ALL_USES | SSA_OP_ALL_DEFS)
+ 
+ /* This macro executes a loop over the operands of STMT specified in FLAG, 
+    returning each operand as a 'tree' in the variable TREEVAR.  ITER is an
+    ssa_op_iter structure used to control the loop.  */
+ #define FOR_EACH_SSA_TREE_OPERAND(TREEVAR, STMT, ITER, FLAGS)	\
+   for (TREEVAR = op_iter_init_tree (&(ITER), STMT, FLAGS);	\
+        !op_iter_done (&(ITER));					\
+        TREEVAR = op_iter_next_tree (&(ITER)))
+ 
+ /* This macro executes a loop over the operands of STMT specified in FLAG, 
+    returning each operand as a 'use_operand_p' in the variable USEVAR.  
+    ITER is an ssa_op_iter structure used to control the loop.  */
+ #define FOR_EACH_SSA_USE_OPERAND(USEVAR, STMT, ITER, FLAGS)	\
+   for (USEVAR = op_iter_init_use (&(ITER), STMT, FLAGS);	\
+        !op_iter_done (&(ITER));					\
+        USEVAR = op_iter_next_use (&(ITER)))
+ 
+ /* This macro executes a loop over the operands of STMT specified in FLAG, 
+    returning each operand as a 'def_operand_p' in the variable DEFVAR.  
+    ITER is an ssa_op_iter structure used to control the loop.  */
+ #define FOR_EACH_SSA_DEF_OPERAND(DEFVAR, STMT, ITER, FLAGS)	\
+   for (DEFVAR = op_iter_init_def (&(ITER), STMT, FLAGS);	\
+        !op_iter_done (&(ITER));					\
+        DEFVAR = op_iter_next_def (&(ITER)))
+ 
+ /* This macro executes a loop over the V_MAY_DEF operands of STMT.  The def
+    and use for each V_MAY_DEF is returned in DEFVAR and USEVAR. 
+    ITER is an ssa_op_iter structure used to control the loop.  */
+ #define FOR_EACH_SSA_MAYDEF_OPERAND(DEFVAR, USEVAR, STMT, ITER)	\
+   for (op_iter_init_maydef (&(ITER), STMT, &(USEVAR), &(DEFVAR));	\
+        !op_iter_done (&(ITER));					\
+        op_iter_next_maydef (&(USEVAR), &(DEFVAR), &(ITER)))
+ 
  #endif  /* GCC_TREE_SSA_OPERANDS_H  */
Index: tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.c,v
retrieving revision 2.31
diff -c -p -r2.31 tree-ssa-operands.c
*** tree-ssa-operands.c	23 Aug 2004 07:47:31 -0000	2.31
--- tree-ssa-operands.c	24 Aug 2004 14:29:49 -0000
*************** static GTY (()) varray_type build_vuses;
*** 114,124 ****
--- 114,128 ----
  /* Array for building all the v_must_def operands.  */
  static GTY (()) varray_type build_v_must_defs;
  
+ 
  #ifdef ENABLE_CHECKING
  /* Used to make sure operand construction is working on the proper stmt.  */
  tree check_build_stmt;
  #endif
  
+ def_operand_p NULL_DEF_OPERAND_P = { NULL };
+ use_operand_p NULL_USE_OPERAND_P = { NULL };
+ 
  static void note_addressable (tree, stmt_ann_t);
  static void get_expr_operands (tree, tree *, int);
  static void get_asm_expr_operands (tree);
Index: tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-flow-inline.h,v
retrieving revision 2.20
diff -c -p -r2.20 tree-flow-inline.h
*** tree-flow-inline.h	12 Aug 2004 14:33:58 -0000	2.20
--- tree-flow-inline.h	24 Aug 2004 14:29:49 -0000
*************** get_tree_ann (tree t)
*** 673,676 ****
--- 673,848 ----
    return (ann) ? ann : create_tree_ann (t);
  }
  
+ /*  -----------------------------------------------------------------------  */
+ 
+ /* The following set of routines are used to iterator over various type of
+    SSA operands.  */
+ 
+ /* Return true if PTR is finished iterating.  */
+ static inline bool
+ op_iter_done (ssa_op_iter *ptr)
+ {
+   return ptr->done;
+ }
+ 
+ /* Get the next iterator use value for PTR.  */
+ static inline use_operand_p
+ op_iter_next_use (ssa_op_iter *ptr)
+ {
+   if (ptr->use_i < ptr->num_use)
+     {
+       return USE_OP_PTR (ptr->ops->use_ops, (ptr->use_i)++);
+     }
+   if (ptr->vuse_i < ptr->num_vuse)
+     {
+       return VUSE_OP_PTR (ptr->ops->vuse_ops, (ptr->vuse_i)++);
+     }
+   if (ptr->v_mayu_i < ptr->num_v_mayu)
+     {
+       return V_MAY_DEF_OP_PTR (ptr->ops->v_may_def_ops,
+ 				       (ptr->v_mayu_i)++);
+     }
+   ptr->done = true;
+   return NULL_USE_OPERAND_P;
+ }
+ 
+ /* Get the next iterator def value for PTR.  */
+ static inline def_operand_p
+ op_iter_next_def (ssa_op_iter *ptr)
+ {
+   if (ptr->def_i < ptr->num_def)
+     {
+       return DEF_OP_PTR (ptr->ops->def_ops, (ptr->def_i)++);
+     }
+   if (ptr->v_must_i < ptr->num_v_must)
+     {
+       return V_MUST_DEF_OP_PTR (ptr->ops->v_must_def_ops, 
+ 					(ptr->v_must_i)++);
+     }
+   if (ptr->v_mayd_i < ptr->num_v_mayd)
+     {
+       return V_MAY_DEF_RESULT_PTR (ptr->ops->v_may_def_ops,
+ 					   (ptr->v_mayd_i)++);
+     }
+   ptr->done = true;
+   return NULL_DEF_OPERAND_P;
+ }
+ 
+ /* Get the next iterator tree value for PTR.  */
+ static inline tree
+ op_iter_next_tree (ssa_op_iter *ptr)
+ {
+   if (ptr->use_i < ptr->num_use)
+     {
+       return USE_OP (ptr->ops->use_ops, (ptr->use_i)++);
+     }
+   if (ptr->vuse_i < ptr->num_vuse)
+     {
+       return VUSE_OP (ptr->ops->vuse_ops, (ptr->vuse_i)++);
+     }
+   if (ptr->v_mayu_i < ptr->num_v_mayu)
+     {
+       return V_MAY_DEF_OP (ptr->ops->v_may_def_ops, (ptr->v_mayu_i)++);
+     }
+   if (ptr->def_i < ptr->num_def)
+     {
+       return DEF_OP (ptr->ops->def_ops, (ptr->def_i)++);
+     }
+   if (ptr->v_must_i < ptr->num_v_must)
+     {
+       return V_MUST_DEF_OP (ptr->ops->v_must_def_ops, 
+ 					(ptr->v_must_i)++);
+     }
+   if (ptr->v_mayd_i < ptr->num_v_mayd)
+     {
+       return V_MAY_DEF_RESULT (ptr->ops->v_may_def_ops,
+ 					   (ptr->v_mayd_i)++);
+     }
+   ptr->done = true;
+   return NULL;
+ }
+ 
+ /* Initialize the iterator PTR to the virtual defs in STMT.  */
+ static inline void
+ op_iter_init (ssa_op_iter *ptr, tree stmt, int flags)
+ {
+   stmt_operands_p ops;
+   stmt_ann_t ann = get_stmt_ann (stmt);
+ 
+   ops = &(ann->operands);
+   ptr->done = false;
+   ptr->ops = ops;
+   ptr->num_def = (flags & SSA_OP_DEF) ? NUM_DEFS (ops->def_ops) : 0;
+   ptr->num_use = (flags & SSA_OP_USE) ? NUM_USES (ops->use_ops) : 0;
+   ptr->num_vuse = (flags & SSA_OP_VUSE) ? NUM_VUSES (ops->vuse_ops) : 0;
+   ptr->num_v_mayu = (flags & SSA_OP_VMAYUSE)
+ 		     ?  NUM_V_MAY_DEFS (ops->v_may_def_ops) : 0;
+   ptr->num_v_mayd = (flags & SSA_OP_VMAYDEF) 
+ 		     ?  NUM_V_MAY_DEFS (ops->v_may_def_ops) : 0;
+   ptr->num_v_must = (flags & SSA_OP_VMUSTDEF) 
+ 		     ? NUM_V_MUST_DEFS (ops->v_must_def_ops) : 0;
+   ptr->def_i = 0;
+   ptr->use_i = 0;
+   ptr->vuse_i = 0;
+   ptr->v_mayu_i = 0;
+   ptr->v_mayd_i = 0;
+   ptr->v_must_i = 0;
+ }
+ 
+ /* Initialize iterator PTR to the use operands in STMT based on FLAGS. Return
+    the first use.  */
+ static inline use_operand_p
+ op_iter_init_use (ssa_op_iter *ptr, tree stmt, int flags)
+ {
+   op_iter_init (ptr, stmt, flags);
+   return op_iter_next_use (ptr);
+ }
+ 
+ /* Initialize iterator PTR to the def operands in STMT based on FLAGS. Return
+    the first def.  */
+ static inline def_operand_p
+ op_iter_init_def (ssa_op_iter *ptr, tree stmt, int flags)
+ {
+   op_iter_init (ptr, stmt, flags);
+   return op_iter_next_def (ptr);
+ }
+ 
+ /* Initialize iterator PTR to the operands in STMT based on FLAGS. Return
+    the first operand as a tree.  */
+ static inline tree
+ op_iter_init_tree (ssa_op_iter *ptr, tree stmt, int flags)
+ {
+   op_iter_init (ptr, stmt, flags);
+   return op_iter_next_tree (ptr);
+ }
+ 
+ /* Get the next iterator maydef value for PTR, returning the maydef values in
+    USE and DEF.  */
+ static inline void
+ op_iter_next_maydef (use_operand_p *use, def_operand_p *def, ssa_op_iter *ptr)
+ {
+   if (ptr->v_mayu_i < ptr->num_v_mayu)
+     {
+       *def = V_MAY_DEF_RESULT_PTR (ptr->ops->v_may_def_ops, ptr->v_mayu_i);
+       *use = V_MAY_DEF_OP_PTR (ptr->ops->v_may_def_ops, (ptr->v_mayu_i)++);
+       return;
+     }
+   else
+     {
+       *def = NULL_DEF_OPERAND_P;
+       *use = NULL_USE_OPERAND_P;
+     }
+   ptr->done = true;
+   return;
+ }
+ 
+ /* Initialize iterator PTR to the operands in STMT.  Return the first operands
+    in USE and DEF.  */
+ static inline void
+ op_iter_init_maydef (ssa_op_iter *ptr, tree stmt, use_operand_p *use, 
+ 		     def_operand_p *def)
+ {
+   op_iter_init (ptr, stmt, SSA_OP_VMAYUSE);
+   op_iter_next_maydef (use, def, ptr);
+ }
  #endif /* _TREE_FLOW_INLINE_H  */





-------------- next part --------------

2004-08-24  Andrew MacLeod  <amacleod@redhat.com>

	* tree-cfg.c (tree_duplicate_bb): Use new operand iterator.
	* tree-dfa.c (compute_immediate_uses_for_stmt, 
	redirect_immediate_uses): Use new operand iterator.
	(v_may_defs_disappeared_p, v_must_defs_disappeared_p): Delete.
	(mark_new_vars_to_rename): Use new operand iterator.  Count virtual
	operands instead of using *_disappeared_p routines.
	* tree-into-ssa.c (mark_def_sites, ssa_mark_def_sites, rewrite_stmt,
	ssa_rewrite_stmt): Use new operand iterator.
	* tree-outof-ssa.c (check_replaceable, find_replaceable_in_bb,
	rewrite_trees): Use new operand iterator.
	* tree-pretty-print.c (dump_vops): Use new operand iterator.
	* tree-sra.c (mark_all_v_defs): Use new operand iterator.
	* tree-ssa-alias.c (compute_points_to_and_addr_escape, 
	dump_points_to_info): Use new operand iterator.
	* tree-ssa-ccp.c (cp_lattice_meet, visit_stmt, initialize, 
	replace_uses_in, replace_vuse_in, likely_value, set_rhs): Use new 
	operand iterator.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary, 
	propagate_necessity): Use new operand iterator.
	* tree-ssa-dom.c (cprop_into_stmt, optimize_stmt): Use operand iterator.
	(register_definitions_for_stmt): Use new operand iterator.  Take stmt as
	a parameter instead of a stmt_ann_t.
	* tree-ssa-live.c (create_ssa_var_map, calculate_live_on_entry,
	build_tree_conflict_graph): Use new operand iterator.
	* tree-ssa-loop-im.c (determine_max_movement, single_reachable_address,
	rewrite_mem_refs): Use new operand iterator.
	* tree-ssa-loop-manip.c (find_uses_to_rename_stmt, 
	check_loop_closed_ssa_use): Use new operand iterator.
	* tree-ssa.c (verify_ssa, replace_immediate_uses): Use operand iterator.
	* tree-ssanames.c (release_defs): Use new operand iterator.
	* tree-vectorizer.c (vect_create_data_ref): Use new operand iterator.



Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.41
diff -c -p -r2.41 tree-cfg.c
*** tree-cfg.c	19 Aug 2004 00:32:41 -0000	2.41
--- tree-cfg.c	24 Aug 2004 14:20:26 -0000
*************** tree_duplicate_bb (basic_block bb)
*** 4222,4232 ****
  {
    basic_block new_bb;
    block_stmt_iterator bsi, bsi_tgt;
!   tree phi;
!   def_optype defs;
!   v_may_def_optype v_may_defs;
!   v_must_def_optype v_must_defs;
!   unsigned j;
  
    new_bb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
  
--- 4222,4229 ----
  {
    basic_block new_bb;
    block_stmt_iterator bsi, bsi_tgt;
!   tree phi, val;
!   ssa_op_iter op_iter;
  
    new_bb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
  
*************** tree_duplicate_bb (basic_block bb)
*** 4247,4263 ****
        /* Record the definitions.  */
        get_stmt_operands (stmt);
  
!       defs = STMT_DEF_OPS (stmt);
!       for (j = 0; j < NUM_DEFS (defs); j++)
! 	mark_for_rewrite (DEF_OP (defs, j));
! 
!       v_may_defs = STMT_V_MAY_DEF_OPS (stmt);
!       for (j = 0; j < NUM_V_MAY_DEFS (v_may_defs); j++)
! 	mark_for_rewrite (V_MAY_DEF_RESULT (v_may_defs, j));
! 
!       v_must_defs = STMT_V_MUST_DEF_OPS (stmt);
!       for (j = 0; j < NUM_V_MUST_DEFS (v_must_defs); j++)
! 	mark_for_rewrite (V_MUST_DEF_OP (v_must_defs, j));
  
        copy = unshare_expr (stmt);
  
--- 4244,4251 ----
        /* Record the definitions.  */
        get_stmt_operands (stmt);
  
!       FOR_EACH_SSA_TREE_OPERAND (val, stmt, op_iter, SSA_OP_ALL_DEFS)
! 	mark_for_rewrite (val);
  
        copy = unshare_expr (stmt);
  
Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-dfa.c,v
retrieving revision 2.24
diff -c -p -r2.24 tree-dfa.c
*** tree-dfa.c	18 Aug 2004 18:21:21 -0000	2.24
--- tree-dfa.c	24 Aug 2004 14:20:27 -0000
*************** compute_immediate_uses_for_phi (tree phi
*** 270,280 ****
  static void
  compute_immediate_uses_for_stmt (tree stmt, int flags, bool (*calc_for)(tree))
  {
!   size_t i;
!   use_optype uses;
!   vuse_optype vuses;
!   v_may_def_optype v_may_defs;
!   stmt_ann_t ann;
  
  #ifdef ENABLE_CHECKING
    /* PHI nodes are handled elsewhere.  */
--- 270,277 ----
  static void
  compute_immediate_uses_for_stmt (tree stmt, int flags, bool (*calc_for)(tree))
  {
!   tree use;
!   ssa_op_iter iter;
  
  #ifdef ENABLE_CHECKING
    /* PHI nodes are handled elsewhere.  */
*************** compute_immediate_uses_for_stmt (tree st
*** 283,295 ****
  #endif
  
    /* Look at USE_OPS or VUSE_OPS according to FLAGS.  */
-   ann = stmt_ann (stmt);
    if (flags & TDFA_USE_OPS)
      {
!       uses = USE_OPS (ann);
!       for (i = 0; i < NUM_USES (uses); i++)
  	{
- 	  tree use = USE_OP (uses, i);
  	  tree imm_stmt = SSA_NAME_DEF_STMT (use);
  	  if (!IS_EMPTY_STMT (imm_stmt) && (!calc_for || calc_for (use)))
  	    add_immediate_use (imm_stmt, stmt);
--- 280,289 ----
  #endif
  
    /* Look at USE_OPS or VUSE_OPS according to FLAGS.  */
    if (flags & TDFA_USE_OPS)
      {
!       FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
  	{
  	  tree imm_stmt = SSA_NAME_DEF_STMT (use);
  	  if (!IS_EMPTY_STMT (imm_stmt) && (!calc_for || calc_for (use)))
  	    add_immediate_use (imm_stmt, stmt);
*************** compute_immediate_uses_for_stmt (tree st
*** 298,318 ****
  
    if (flags & TDFA_USE_VOPS)
      {
!       vuses = VUSE_OPS (ann);
!       for (i = 0; i < NUM_VUSES (vuses); i++)
! 	{
! 	  tree vuse = VUSE_OP (vuses, i);
! 	  tree imm_rdef_stmt = SSA_NAME_DEF_STMT (vuse);
! 	  if (!IS_EMPTY_STMT (imm_rdef_stmt) && (!calc_for || calc_for (vuse)))
! 	    add_immediate_use (imm_rdef_stmt, stmt);
! 	}
! 
!       v_may_defs = V_MAY_DEF_OPS (ann);
!       for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
  	{
! 	  tree vuse = V_MAY_DEF_OP (v_may_defs, i);
! 	  tree imm_rdef_stmt = SSA_NAME_DEF_STMT (vuse);
! 	  if (!IS_EMPTY_STMT (imm_rdef_stmt) && (!calc_for || calc_for (vuse)))
  	    add_immediate_use (imm_rdef_stmt, stmt);
  	}
      }
--- 292,301 ----
  
    if (flags & TDFA_USE_VOPS)
      {
!       FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_VIRTUAL_USES)
  	{
! 	  tree imm_rdef_stmt = SSA_NAME_DEF_STMT (use);
! 	  if (!IS_EMPTY_STMT (imm_rdef_stmt) && (!calc_for || calc_for (use)))
  	    add_immediate_use (imm_rdef_stmt, stmt);
  	}
      }
*************** redirect_immediate_use (tree use, tree o
*** 380,400 ****
  void
  redirect_immediate_uses (tree old, tree new)
  {
!   stmt_ann_t ann = get_stmt_ann (old);
!   use_optype uses = USE_OPS (ann);
!   vuse_optype vuses = VUSE_OPS (ann);
!   v_may_def_optype v_may_defs = V_MAY_DEF_OPS (ann);
!   unsigned int i;
! 
!   /* Look at USE_OPS or VUSE_OPS according to FLAGS.  */
!   for (i = 0; i < NUM_USES (uses); i++)
!     redirect_immediate_use (USE_OP (uses, i), old, new);
  
!   for (i = 0; i < NUM_VUSES (vuses); i++)
!     redirect_immediate_use (VUSE_OP (vuses, i), old, new);
! 
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
!     redirect_immediate_use (V_MAY_DEF_OP (v_may_defs, i), old, new);
  }
  
  
--- 363,373 ----
  void
  redirect_immediate_uses (tree old, tree new)
  {
!   ssa_op_iter iter;
!   tree val;
  
!   FOR_EACH_SSA_TREE_OPERAND (val, old, iter, SSA_OP_ALL_USES)
!     redirect_immediate_use (val, old, new);
  }
  
  
*************** add_referenced_tmp_var (tree var)
*** 956,1003 ****
    add_referenced_var (var, NULL);
  }
  
- /* Return true if V_MAY_DEFS_AFTER contains fewer entries than
-    V_MAY_DEFS_BEFORE. Note that this assumes that both varrays
-    are V_MAY_DEF operands for the same statement.  */
- 
- static inline bool
- v_may_defs_disappeared_p (v_may_def_optype v_may_defs_before,
-                           v_may_def_optype v_may_defs_after)
- {
-   /* If there was nothing before, nothing could've disappeared.  */
-   if (v_may_defs_before == NULL)
-     return false;
- 
-   /* All/some of them gone.  */
-   if (v_may_defs_after == NULL
-       || NUM_V_MAY_DEFS (v_may_defs_before) >
-          NUM_V_MAY_DEFS (v_may_defs_after))
-     return true;
- 
-   return false;
- }
- 
- /* Return true if V_MUST_DEFS_AFTER contains fewer entries than
-    V_MUST_DEFS_BEFORE. Note that this assumes that both varrays
-    are V_MUST_DEF operands for the same statement.  */
- 
- static inline bool
- v_must_defs_disappeared_p (v_must_def_optype v_must_defs_before,
-                            v_must_def_optype v_must_defs_after)
- {
-   /* If there was nothing before, nothing could've disappeared.  */
-   if (v_must_defs_before == NULL)
-     return false;
- 
-   /* All/some of them gone.  */
-   if (v_must_defs_after == NULL
-       || NUM_V_MUST_DEFS (v_must_defs_before) >
-          NUM_V_MUST_DEFS (v_must_defs_after))
-     return true;
- 
-   return false;
- }
- 
  
  /* Add all the non-SSA variables found in STMT's operands to the bitmap
     VARS_TO_RENAME.  */
--- 929,934 ----
*************** v_must_defs_disappeared_p (v_must_def_op
*** 1005,1021 ****
  void
  mark_new_vars_to_rename (tree stmt, bitmap vars_to_rename)
  {
!   def_optype defs;
!   use_optype uses;
!   v_may_def_optype v_may_defs;
!   vuse_optype vuses;
!   v_must_def_optype v_must_defs;
!   size_t i;
    bitmap vars_in_vops_to_rename;
    bool found_exposed_symbol = false;
!   v_may_def_optype v_may_defs_before, v_may_defs_after;
!   v_must_def_optype v_must_defs_before, v_must_defs_after;
!   stmt_ann_t ann;
  
    vars_in_vops_to_rename = BITMAP_XMALLOC ();
  
--- 936,947 ----
  void
  mark_new_vars_to_rename (tree stmt, bitmap vars_to_rename)
  {
!   ssa_op_iter iter;
!   tree val;
    bitmap vars_in_vops_to_rename;
    bool found_exposed_symbol = false;
!   int v_may_defs_before, v_may_defs_after;
!   int v_must_defs_before, v_must_defs_after;
  
    vars_in_vops_to_rename = BITMAP_XMALLOC ();
  
*************** mark_new_vars_to_rename (tree stmt, bitm
*** 1028,1059 ****
       We flag them in a separate bitmap because we don't really want to
       rename them if there are not any newly exposed symbols in the
       statement operands.  */
!   ann = stmt_ann (stmt);
!   v_may_defs_before = v_may_defs = V_MAY_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
!     {
!       tree var = V_MAY_DEF_RESULT (v_may_defs, i);
!       if (!DECL_P (var))
! 	var = SSA_NAME_VAR (var);
!       bitmap_set_bit (vars_in_vops_to_rename, var_ann (var)->uid);
!     }
  
!   vuses = VUSE_OPS (ann);
!   for (i = 0; i < NUM_VUSES (vuses); i++)
      {
!       tree var = VUSE_OP (vuses, i);
!       if (!DECL_P (var))
! 	var = SSA_NAME_VAR (var);
!       bitmap_set_bit (vars_in_vops_to_rename, var_ann (var)->uid);
!     }
! 
!   v_must_defs_before = v_must_defs = V_MUST_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
!     {
!       tree var = V_MUST_DEF_OP (v_must_defs, i);
!       if (!DECL_P (var))
! 	var = SSA_NAME_VAR (var);
!       bitmap_set_bit (vars_in_vops_to_rename, var_ann (var)->uid);
      }
  
    /* Now force an operand re-scan on the statement and mark any newly
--- 954,968 ----
       We flag them in a separate bitmap because we don't really want to
       rename them if there are not any newly exposed symbols in the
       statement operands.  */
!   v_may_defs_before = NUM_V_MAY_DEFS (STMT_V_MAY_DEF_OPS (stmt));
!   v_must_defs_before = NUM_V_MUST_DEFS (STMT_V_MUST_DEF_OPS (stmt));
  
!   FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter, 
! 			     SSA_OP_VMAYDEF | SSA_OP_VUSE | SSA_OP_VMUSTDEF)
      {
!       if (!DECL_P (val))
! 	val = SSA_NAME_VAR (val);
!       bitmap_set_bit (vars_in_vops_to_rename, var_ann (val)->uid);
      }
  
    /* Now force an operand re-scan on the statement and mark any newly
*************** mark_new_vars_to_rename (tree stmt, bitm
*** 1061,1118 ****
    modify_stmt (stmt);
    get_stmt_operands (stmt);
  
!   defs = DEF_OPS (ann);
!   for (i = 0; i < NUM_DEFS (defs); i++)
!     {
!       tree var = DEF_OP (defs, i);
!       if (DECL_P (var))
! 	{
! 	  found_exposed_symbol = true;
! 	  bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
! 	}
!     }
! 
!   uses = USE_OPS (ann);
!   for (i = 0; i < NUM_USES (uses); i++)
!     {
!       tree var = USE_OP (uses, i);
!       if (DECL_P (var))
! 	{
! 	  found_exposed_symbol = true;
! 	  bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
! 	}
!     }
  
!   v_may_defs_after = v_may_defs = V_MAY_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
!     {
!       tree var = V_MAY_DEF_RESULT (v_may_defs, i);
!       if (DECL_P (var))
! 	{
! 	  found_exposed_symbol = true;
! 	  bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
! 	}
!     }
! 
!   vuses = VUSE_OPS (ann);
!   for (i = 0; i < NUM_VUSES (vuses); i++)
!     {
!       tree var = VUSE_OP (vuses, i);
!       if (DECL_P (var))
! 	{
! 	  found_exposed_symbol = true;
! 	  bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
! 	}
!     }
  
-   v_must_defs_after = v_must_defs = V_MUST_DEF_OPS (ann);
-   for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
      {
!       tree var = V_MUST_DEF_OP (v_must_defs, i);
!       if (DECL_P (var))
  	{
  	  found_exposed_symbol = true;
! 	  bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
  	}
      }
  
--- 970,986 ----
    modify_stmt (stmt);
    get_stmt_operands (stmt);
  
!   v_may_defs_after = NUM_V_MAY_DEFS (STMT_V_MAY_DEF_OPS (stmt));
!   v_must_defs_after = NUM_V_MUST_DEFS (STMT_V_MUST_DEF_OPS (stmt));
  
!   FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter, 
! 			     SSA_OP_VMAYDEF | SSA_OP_VUSE | SSA_OP_VMUSTDEF)
  
      {
!       if (DECL_P (val))
  	{
  	  found_exposed_symbol = true;
! 	  bitmap_set_bit (vars_to_rename, var_ann (val)->uid);
  	}
      }
  
*************** mark_new_vars_to_rename (tree stmt, bitm
*** 1122,1129 ****
       vanishing VDEFs because in those cases, the names that were formerly
       generated by this statement are not going to be available anymore.  */
    if (found_exposed_symbol
!       || v_may_defs_disappeared_p (v_may_defs_before, v_may_defs_after)
!       || v_must_defs_disappeared_p (v_must_defs_before, v_must_defs_after))
      bitmap_a_or_b (vars_to_rename, vars_to_rename, vars_in_vops_to_rename);
  
    BITMAP_XFREE (vars_in_vops_to_rename);
--- 990,997 ----
       vanishing VDEFs because in those cases, the names that were formerly
       generated by this statement are not going to be available anymore.  */
    if (found_exposed_symbol
!       || v_may_defs_before > v_may_defs_after
!       || v_must_defs_before > v_must_defs_after)
      bitmap_a_or_b (vars_to_rename, vars_to_rename, vars_in_vops_to_rename);
  
    BITMAP_XFREE (vars_in_vops_to_rename);
Index: tree-into-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-into-ssa.c,v
retrieving revision 2.14
diff -c -p -r2.14 tree-into-ssa.c
*** tree-into-ssa.c	4 Aug 2004 20:37:38 -0000	2.14
--- tree-into-ssa.c	24 Aug 2004 14:20:27 -0000
*************** mark_def_sites (struct dom_walk_data *wa
*** 342,412 ****
  {
    struct mark_def_sites_global_data *gd = walk_data->global_data;
    sbitmap kills = gd->kills;
!   v_may_def_optype v_may_defs;
!   v_must_def_optype v_must_defs;
!   vuse_optype vuses;
!   def_optype defs;
!   use_optype uses;
!   size_t i, uid;
!   tree stmt;
!   stmt_ann_t ann;
  
    /* Mark all the blocks that have definitions for each variable in the
       VARS_TO_RENAME bitmap.  */
    stmt = bsi_stmt (bsi);
    get_stmt_operands (stmt);
-   ann = stmt_ann (stmt);
  
    /* If a variable is used before being set, then the variable is live
       across a block boundary, so mark it live-on-entry to BB.  */
-   uses = USE_OPS (ann);
-   for (i = 0; i < NUM_USES (uses); i++)
-     {
-       use_operand_p use_p = USE_OP_PTR (uses, i);
  
!       if (prepare_use_operand_for_rename (use_p, &uid)
! 	  && !TEST_BIT (kills, uid))
! 	set_livein_block (USE_FROM_PTR (use_p), bb);
!     }
! 	  
!   /* Similarly for virtual uses.  */
!   vuses = VUSE_OPS (ann);
!   for (i = 0; i < NUM_VUSES (vuses); i++)
      {
-       use_operand_p use_p = VUSE_OP_PTR (vuses, i);
- 
        if (prepare_use_operand_for_rename (use_p, &uid)
  	  && !TEST_BIT (kills, uid))
  	set_livein_block (USE_FROM_PTR (use_p), bb);
      }
! 
    /* Note that virtual definitions are irrelevant for computing KILLS
       because a V_MAY_DEF does not constitute a killing definition of the
       variable.  However, the operand of a virtual definitions is a use
       of the variable, so it may cause the variable to be considered
       live-on-entry.  */
!   v_may_defs = V_MAY_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
      {
-       use_operand_p use_p = V_MAY_DEF_OP_PTR (v_may_defs, i);
        if (prepare_use_operand_for_rename (use_p, &uid))
  	{
  	  /* If we do not already have an SSA_NAME for our destination,
  	     then set the destination to the source.  */
! 	  if (TREE_CODE (V_MAY_DEF_RESULT (v_may_defs, i)) != SSA_NAME)
! 	    SET_V_MAY_DEF_RESULT (v_may_defs, i, USE_FROM_PTR (use_p));
  	    
            set_livein_block (USE_FROM_PTR (use_p), bb);
! 	  set_def_block (V_MAY_DEF_RESULT (v_may_defs, i), bb, false, false);
  	}
      }
  
    /* Now process the virtual must-defs made by this statement.  */
!   v_must_defs = V_MUST_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
      {
-       tree def = V_MUST_DEF_OP (v_must_defs, i);
- 
        if (prepare_def_operand_for_rename (def, &uid))
  	{
  	  set_def_block (def, bb, false, false);
--- 342,391 ----
  {
    struct mark_def_sites_global_data *gd = walk_data->global_data;
    sbitmap kills = gd->kills;
!   size_t uid;
!   tree stmt, def;
!   use_operand_p use_p;
!   def_operand_p def_p;
!   ssa_op_iter iter;
  
    /* Mark all the blocks that have definitions for each variable in the
       VARS_TO_RENAME bitmap.  */
    stmt = bsi_stmt (bsi);
    get_stmt_operands (stmt);
  
    /* If a variable is used before being set, then the variable is live
       across a block boundary, so mark it live-on-entry to BB.  */
  
!   FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE | SSA_OP_VUSE)
      {
        if (prepare_use_operand_for_rename (use_p, &uid)
  	  && !TEST_BIT (kills, uid))
  	set_livein_block (USE_FROM_PTR (use_p), bb);
      }
! 	  
    /* Note that virtual definitions are irrelevant for computing KILLS
       because a V_MAY_DEF does not constitute a killing definition of the
       variable.  However, the operand of a virtual definitions is a use
       of the variable, so it may cause the variable to be considered
       live-on-entry.  */
! 
!   FOR_EACH_SSA_MAYDEF_OPERAND (def_p, use_p, stmt, iter)
      {
        if (prepare_use_operand_for_rename (use_p, &uid))
  	{
  	  /* If we do not already have an SSA_NAME for our destination,
  	     then set the destination to the source.  */
! 	  if (TREE_CODE (DEF_FROM_PTR (def_p)) != SSA_NAME)
! 	    SET_DEF (def_p, USE_FROM_PTR (use_p));
  	    
            set_livein_block (USE_FROM_PTR (use_p), bb);
! 	  set_def_block (DEF_FROM_PTR (def_p), bb, false, false);
  	}
      }
  
    /* Now process the virtual must-defs made by this statement.  */
!   FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF | SSA_OP_VMUSTDEF)
      {
        if (prepare_def_operand_for_rename (def, &uid))
  	{
  	  set_def_block (def, bb, false, false);
*************** mark_def_sites (struct dom_walk_data *wa
*** 414,432 ****
  	}
      }
  
-   /* Now process the definition made by this statement.  Mark the
-      variables in KILLS.  */
-   defs = DEF_OPS (ann);
-   for (i = 0; i < NUM_DEFS (defs); i++)
-     {
-       tree def = DEF_OP (defs, i);
- 
-       if (prepare_def_operand_for_rename (def, &uid))
- 	{
- 	  set_def_block (def, bb, false, false);
- 	  SET_BIT (kills, uid);
- 	}
-     }
  }
  
  /* Ditto, but works over ssa names.  */
--- 393,398 ----
*************** ssa_mark_def_sites (struct dom_walk_data
*** 438,464 ****
  {
    struct mark_def_sites_global_data *gd = walk_data->global_data;
    sbitmap kills = gd->kills;
!   v_may_def_optype v_may_defs;
!   v_must_def_optype v_must_defs;
!   vuse_optype vuses;
!   def_optype defs;
!   use_optype uses;
!   size_t i, uid, def_uid;
    tree stmt, use, def;
!   stmt_ann_t ann;
  
    /* Mark all the blocks that have definitions for each variable in the
       names_to_rename bitmap.  */
    stmt = bsi_stmt (bsi);
    get_stmt_operands (stmt);
-   ann = stmt_ann (stmt);
  
    /* If a variable is used before being set, then the variable is live
       across a block boundary, so mark it live-on-entry to BB.  */
!   uses = USE_OPS (ann);
!   for (i = 0; i < NUM_USES (uses); i++)
      {
-       use = USE_OP (uses, i);
        uid = SSA_NAME_VERSION (use);
  
        if (TEST_BIT (gd->names_to_rename, uid)
--- 404,422 ----
  {
    struct mark_def_sites_global_data *gd = walk_data->global_data;
    sbitmap kills = gd->kills;
!   size_t uid, def_uid;
    tree stmt, use, def;
!   ssa_op_iter iter;
  
    /* Mark all the blocks that have definitions for each variable in the
       names_to_rename bitmap.  */
    stmt = bsi_stmt (bsi);
    get_stmt_operands (stmt);
  
    /* If a variable is used before being set, then the variable is live
       across a block boundary, so mark it live-on-entry to BB.  */
!   FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_ALL_USES)
      {
        uid = SSA_NAME_VERSION (use);
  
        if (TEST_BIT (gd->names_to_rename, uid)
*************** ssa_mark_def_sites (struct dom_walk_data
*** 466,526 ****
  	set_livein_block (use, bb);
      }
  	  
-   /* Similarly for virtual uses.  */
-   vuses = VUSE_OPS (ann);
-   for (i = 0; i < NUM_VUSES (vuses); i++)
-     {
-       use = VUSE_OP (vuses, i);
-       uid = SSA_NAME_VERSION (use);
- 
-       if (TEST_BIT (gd->names_to_rename, uid)
- 	  && !TEST_BIT (kills, uid))
- 	set_livein_block (use, bb);
-     }
- 
-   v_may_defs = V_MAY_DEF_OPS (ann);
-   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
-     {
-       use = V_MAY_DEF_OP (v_may_defs, i);
-       uid = SSA_NAME_VERSION (use);
- 
-       if (TEST_BIT (gd->names_to_rename, uid)
- 	  && !TEST_BIT (kills, uid))
- 	set_livein_block (use, bb);
-     }
- 
    /* Now process the definition made by this statement.  Mark the
       variables in KILLS.  */
!   defs = DEF_OPS (ann);
!   for (i = 0; i < NUM_DEFS (defs); i++)
!     {
!       def = DEF_OP (defs, i);
!       def_uid = SSA_NAME_VERSION (def);
! 
!       if (TEST_BIT (gd->names_to_rename, def_uid))
! 	{
! 	  set_def_block (def, bb, false, true);
! 	  SET_BIT (kills, def_uid);
! 	}
!     }
! 
!   v_may_defs = V_MAY_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
!     {
!       def = V_MAY_DEF_RESULT (v_may_defs, i);
!       def_uid = SSA_NAME_VERSION (def);
! 
!       if (TEST_BIT (gd->names_to_rename, def_uid))
! 	{
! 	  set_def_block (def, bb, false, true);
! 	  SET_BIT (kills, def_uid);
! 	}
!     }
! 
!   v_must_defs = V_MUST_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
      {
-       def = V_MUST_DEF_OP (v_must_defs, i);
        def_uid = SSA_NAME_VERSION (def);
  
        if (TEST_BIT (gd->names_to_rename, def_uid))
--- 424,433 ----
  	set_livein_block (use, bb);
      }
  	  
    /* Now process the definition made by this statement.  Mark the
       variables in KILLS.  */
!   FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS)
      {
        def_uid = SSA_NAME_VERSION (def);
  
        if (TEST_BIT (gd->names_to_rename, def_uid))
*************** rewrite_stmt (struct dom_walk_data *walk
*** 1138,1151 ****
  	      basic_block bb ATTRIBUTE_UNUSED,
  	      block_stmt_iterator si)
  {
-   size_t i;
    stmt_ann_t ann;
    tree stmt;
!   vuse_optype vuses;
!   v_may_def_optype v_may_defs;
!   v_must_def_optype v_must_defs;
!   def_optype defs;
!   use_optype uses;
    struct rewrite_block_data *bd;
  
    bd = VARRAY_TOP_GENERIC_PTR (walk_data->block_data_stack);
--- 1045,1055 ----
  	      basic_block bb ATTRIBUTE_UNUSED,
  	      block_stmt_iterator si)
  {
    stmt_ann_t ann;
    tree stmt;
!   use_operand_p use_p;
!   def_operand_p def_p;
!   ssa_op_iter iter;
    struct rewrite_block_data *bd;
  
    bd = VARRAY_TOP_GENERIC_PTR (walk_data->block_data_stack);
*************** rewrite_stmt (struct dom_walk_data *walk
*** 1167,1191 ****
      abort ();
  #endif
  
-   defs = DEF_OPS (ann);
-   uses = USE_OPS (ann);
-   vuses = VUSE_OPS (ann);
-   v_may_defs = V_MAY_DEF_OPS (ann);
-   v_must_defs = V_MUST_DEF_OPS (ann);
- 
    /* Step 1.  Rewrite USES and VUSES in the statement.  */
!   for (i = 0; i < NUM_USES (uses); i++)
!     rewrite_operand (USE_OP_PTR (uses, i));
! 
!   /* Rewrite virtual uses in the statement.  */
!   for (i = 0; i < NUM_VUSES (vuses); i++)
!     rewrite_operand (VUSE_OP_PTR (vuses, i));
  
    /* Step 2.  Register the statement's DEF and VDEF operands.  */
!   for (i = 0; i < NUM_DEFS (defs); i++)
      {
-       def_operand_p def_p = DEF_OP_PTR (defs, i);
- 
        if (TREE_CODE (DEF_FROM_PTR (def_p)) != SSA_NAME)
  	SET_DEF (def_p, make_ssa_name (DEF_FROM_PTR (def_p), stmt));
  
--- 1071,1083 ----
      abort ();
  #endif
  
    /* Step 1.  Rewrite USES and VUSES in the statement.  */
!   FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
!     rewrite_operand (use_p);
  
    /* Step 2.  Register the statement's DEF and VDEF operands.  */
!   FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_ALL_DEFS)
      {
        if (TREE_CODE (DEF_FROM_PTR (def_p)) != SSA_NAME)
  	SET_DEF (def_p, make_ssa_name (DEF_FROM_PTR (def_p), stmt));
  
*************** rewrite_stmt (struct dom_walk_data *walk
*** 1193,1228 ****
  	 doesn't need to be renamed.  */
        register_new_def (DEF_FROM_PTR (def_p), &bd->block_defs);
      }
- 
-   /* Register new virtual definitions made by the statement.  */
-   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
-     {
-       rewrite_operand (V_MAY_DEF_OP_PTR (v_may_defs, i));
- 
-       if (TREE_CODE (V_MAY_DEF_RESULT (v_may_defs, i)) != SSA_NAME)
- 	SET_V_MAY_DEF_RESULT (v_may_defs, i,
- 			      make_ssa_name (V_MAY_DEF_RESULT (v_may_defs, i), 
- 					     stmt));
- 
-       /* FIXME: We shouldn't be registering new defs if the variable
- 	 doesn't need to be renamed.  */
-       register_new_def (V_MAY_DEF_RESULT (v_may_defs, i), &bd->block_defs);
-     }
-         
-   /* Register new virtual mustdefs made by the statement.  */
-   for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
-     {
-       def_operand_p v_must_def_p = V_MUST_DEF_OP_PTR (v_must_defs, i);
- 
-       if (TREE_CODE (DEF_FROM_PTR (v_must_def_p)) != SSA_NAME)
- 	SET_DEF (v_must_def_p, 
- 		 make_ssa_name (DEF_FROM_PTR (v_must_def_p), stmt));
- 
-       /* FIXME: We shouldn't be registering new mustdefs if the variable
- 	 doesn't need to be renamed.  */
-       register_new_def (DEF_FROM_PTR (v_must_def_p), &bd->block_defs);
-     }
-     
  }
  
  /* Ditto, for rewriting ssa names.  */
--- 1085,1090 ----
*************** ssa_rewrite_stmt (struct dom_walk_data *
*** 1232,1247 ****
  		  basic_block bb ATTRIBUTE_UNUSED,
  		  block_stmt_iterator si)
  {
-   size_t i;
    stmt_ann_t ann;
    tree stmt, var;
    use_operand_p use_p;
    def_operand_p def_p;
-   vuse_optype vuses;
-   v_may_def_optype v_may_defs;
-   v_must_def_optype v_must_defs;
-   def_optype defs;
-   use_optype uses;
    struct rewrite_block_data *bd;
    sbitmap names_to_rename = walk_data->global_data;
  
--- 1094,1104 ----
  		  basic_block bb ATTRIBUTE_UNUSED,
  		  block_stmt_iterator si)
  {
    stmt_ann_t ann;
    tree stmt, var;
+   ssa_op_iter iter;
    use_operand_p use_p;
    def_operand_p def_p;
    struct rewrite_block_data *bd;
    sbitmap names_to_rename = walk_data->global_data;
  
*************** ssa_rewrite_stmt (struct dom_walk_data *
*** 1264,1327 ****
      abort ();
  #endif
  
-   defs = DEF_OPS (ann);
-   uses = USE_OPS (ann);
-   vuses = VUSE_OPS (ann);
-   v_may_defs = V_MAY_DEF_OPS (ann);
-   v_must_defs = V_MUST_DEF_OPS (ann);
- 
    /* Step 1.  Rewrite USES and VUSES in the statement.  */
!   for (i = 0; i < NUM_USES (uses); i++)
      {
-       use_p = USE_OP_PTR (uses, i);
-       if (TEST_BIT (names_to_rename, SSA_NAME_VERSION (USE_FROM_PTR (use_p))))
- 	SET_USE (use_p, get_reaching_def (USE_FROM_PTR (use_p)));
-     }
- 
-   /* Rewrite virtual uses in the statement.  */
-   for (i = 0; i < NUM_VUSES (vuses); i++)
-     {
-       use_p = VUSE_OP_PTR (vuses, i);
-       if (TEST_BIT (names_to_rename, SSA_NAME_VERSION (USE_FROM_PTR (use_p))))
- 	SET_USE (use_p, get_reaching_def (USE_FROM_PTR (use_p)));
-     }
- 
-   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
-     {
-       use_p = V_MAY_DEF_OP_PTR (v_may_defs, i);
        if (TEST_BIT (names_to_rename, SSA_NAME_VERSION (USE_FROM_PTR (use_p))))
  	SET_USE (use_p, get_reaching_def (USE_FROM_PTR (use_p)));
      }
  
    /* Step 2.  Register the statement's DEF and VDEF operands.  */
!   for (i = 0; i < NUM_DEFS (defs); i++)
!     {
!       def_p = DEF_OP_PTR (defs, i);
!       var = DEF_FROM_PTR (def_p);
! 
!       if (!TEST_BIT (names_to_rename, SSA_NAME_VERSION (var)))
! 	continue;
! 
!       SET_DEF (def_p, duplicate_ssa_name (var, stmt));
!       ssa_register_new_def (var, DEF_FROM_PTR (def_p), &bd->block_defs);
!     }
! 
!   /* Register new virtual definitions made by the statement.  */
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
!     {
!       def_p = V_MAY_DEF_RESULT_PTR (v_may_defs, i);
!       var = DEF_FROM_PTR (def_p);
! 
!       if (!TEST_BIT (names_to_rename, SSA_NAME_VERSION (var)))
! 	continue;
! 
!       SET_DEF (def_p, duplicate_ssa_name (var, stmt));
!       ssa_register_new_def (var, DEF_FROM_PTR (def_p), &bd->block_defs);
!     }
! 
!   for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
      {
-       def_p = V_MUST_DEF_OP_PTR (v_must_defs, i);
        var = DEF_FROM_PTR (def_p);
  
        if (!TEST_BIT (names_to_rename, SSA_NAME_VERSION (var)))
--- 1121,1136 ----
      abort ();
  #endif
  
    /* Step 1.  Rewrite USES and VUSES in the statement.  */
!   FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
      {
        if (TEST_BIT (names_to_rename, SSA_NAME_VERSION (USE_FROM_PTR (use_p))))
  	SET_USE (use_p, get_reaching_def (USE_FROM_PTR (use_p)));
      }
  
    /* Step 2.  Register the statement's DEF and VDEF operands.  */
!   FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_ALL_DEFS)
      {
        var = DEF_FROM_PTR (def_p);
  
        if (!TEST_BIT (names_to_rename, SSA_NAME_VERSION (var)))
Index: tree-outof-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-outof-ssa.c,v
retrieving revision 2.15
diff -c -p -r2.15 tree-outof-ssa.c
*** tree-outof-ssa.c	10 Aug 2004 18:31:25 -0000	2.15
--- tree-outof-ssa.c	24 Aug 2004 14:20:27 -0000
*************** check_replaceable (temp_expr_table_p tab
*** 1461,1468 ****
    def_optype defs;
    use_optype uses;
    tree var, def;
!   int num_use_ops, version, i;
    var_map map = tab->map;
  
    if (TREE_CODE (stmt) != MODIFY_EXPR)
      return false;
--- 1461,1469 ----
    def_optype defs;
    use_optype uses;
    tree var, def;
!   int num_use_ops, version;
    var_map map = tab->map;
+   ssa_op_iter iter;
  
    if (TREE_CODE (stmt) != MODIFY_EXPR)
      return false;
*************** check_replaceable (temp_expr_table_p tab
*** 1512,1520 ****
    version = SSA_NAME_VERSION (def);
  
    /* Add this expression to the dependency list for each use partition.  */
!   for (i = 0; i < num_use_ops; i++)
      {
-       var = USE_OP (uses, i);
        add_dependance (tab, version, var);
      }
  
--- 1513,1520 ----
    version = SSA_NAME_VERSION (def);
  
    /* Add this expression to the dependency list for each use partition.  */
!   FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_USE)
      {
        add_dependance (tab, version, var);
      }
  
*************** find_replaceable_in_bb (temp_expr_table_
*** 1646,1656 ****
    block_stmt_iterator bsi;
    tree stmt, def;
    stmt_ann_t ann;
!   int partition, num, i;
!   use_optype uses;
!   def_optype defs;
    var_map map = tab->map;
    value_expr_p p;
  
    for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
      {
--- 1646,1655 ----
    block_stmt_iterator bsi;
    tree stmt, def;
    stmt_ann_t ann;
!   int partition;
    var_map map = tab->map;
    value_expr_p p;
+   ssa_op_iter iter;
  
    for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
      {
*************** find_replaceable_in_bb (temp_expr_table_
*** 1658,1668 ****
        ann = stmt_ann (stmt);
  
        /* Determine if this stmt finishes an existing expression.  */
!       uses = USE_OPS (ann);
!       num = NUM_USES (uses);
!       for (i = 0; i < num; i++)
  	{
- 	  def = USE_OP (uses, i);
  	  if (tab->version_info[SSA_NAME_VERSION (def)])
  	    {
  	      /* Mark expression as replaceable unless stmt is volatile.  */
--- 1657,1664 ----
        ann = stmt_ann (stmt);
  
        /* Determine if this stmt finishes an existing expression.  */
!       FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_USE)
  	{
  	  if (tab->version_info[SSA_NAME_VERSION (def)])
  	    {
  	      /* Mark expression as replaceable unless stmt is volatile.  */
*************** find_replaceable_in_bb (temp_expr_table_
*** 1674,1684 ****
  	}
        
        /* Next, see if this stmt kills off an active expression.  */
!       defs = DEF_OPS (ann);
!       num = NUM_DEFS (defs);
!       for (i = 0; i < num; i++)
  	{
- 	  def = DEF_OP (defs, i);
  	  partition = var_to_partition (map, def);
  	  if (partition != NO_PARTITION && tab->partition_dep_list[partition])
  	    kill_expr (tab, partition, true);
--- 1670,1677 ----
  	}
        
        /* Next, see if this stmt kills off an active expression.  */
!       FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF)
  	{
  	  partition = var_to_partition (map, def);
  	  if (partition != NO_PARTITION && tab->partition_dep_list[partition])
  	    kill_expr (tab, partition, true);
*************** rewrite_trees (var_map map, tree *values
*** 1880,1892 ****
      {
        for (si = bsi_start (bb); !bsi_end_p (si); )
  	{
! 	  size_t i, num_uses, num_defs;
  	  use_optype uses;
  	  def_optype defs;
  	  tree stmt = bsi_stmt (si);
  	  use_operand_p use_p;
  	  int remove = 0, is_copy = 0;
  	  stmt_ann_t ann;
  
  	  get_stmt_operands (stmt);
  	  ann = stmt_ann (stmt);
--- 1873,1887 ----
      {
        for (si = bsi_start (bb); !bsi_end_p (si); )
  	{
! 	  size_t num_uses, num_defs;
  	  use_optype uses;
  	  def_optype defs;
  	  tree stmt = bsi_stmt (si);
  	  use_operand_p use_p;
+ 	  def_operand_p def_p;
  	  int remove = 0, is_copy = 0;
  	  stmt_ann_t ann;
+ 	  ssa_op_iter iter;
  
  	  get_stmt_operands (stmt);
  	  ann = stmt_ann (stmt);
*************** rewrite_trees (var_map map, tree *values
*** 1898,1907 ****
  
  	  uses = USE_OPS (ann);
  	  num_uses = NUM_USES (uses);
! 
! 	  for (i = 0; i < num_uses; i++)
  	    {
- 	      use_p = USE_OP_PTR (uses, i);
  	      if (replace_use_variable (map, use_p, values))
  	        changed = true;
  	    }
--- 1893,1900 ----
  
  	  uses = USE_OPS (ann);
  	  num_uses = NUM_USES (uses);
! 	  FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
  	    {
  	      if (replace_use_variable (map, use_p, values))
  	        changed = true;
  	    }
*************** rewrite_trees (var_map map, tree *values
*** 1921,1930 ****
  	    }
  	  if (!remove)
  	    {
! 	      for (i = 0; i < num_defs; i++)
  		{
- 		  def_operand_p def_p = DEF_OP_PTR (defs, i);
- 
  		  if (replace_def_variable (map, def_p, NULL))
  		    changed = true;
  
--- 1914,1921 ----
  	    }
  	  if (!remove)
  	    {
! 	      FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_DEF)
  		{
  		  if (replace_def_variable (map, def_p, NULL))
  		    changed = true;
  
Index: tree-pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-pretty-print.c,v
retrieving revision 2.30
diff -c -p -r2.30 tree-pretty-print.c
*** tree-pretty-print.c	15 Aug 2004 15:45:00 -0000	2.30
--- tree-pretty-print.c	24 Aug 2004 14:20:27 -0000
*************** newline_and_indent (pretty_printer *buff
*** 2036,2073 ****
  static void
  dump_vops (pretty_printer *buffer, tree stmt, int spc, int flags)
  {
!   size_t i;
!   stmt_ann_t ann = stmt_ann (stmt);
!   v_may_def_optype v_may_defs = V_MAY_DEF_OPS (ann);
!   v_must_def_optype v_must_defs = V_MUST_DEF_OPS (ann);
!   vuse_optype vuses = VUSE_OPS (ann);
  
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
      {
        pp_string (buffer, "#   ");
!       dump_generic_node (buffer, V_MAY_DEF_RESULT (v_may_defs, i),
                           spc + 2, flags, false);
        pp_string (buffer, " = V_MAY_DEF <");
!       dump_generic_node (buffer, V_MAY_DEF_OP (v_may_defs, i),
                           spc + 2, flags, false);
        pp_string (buffer, ">;");
        newline_and_indent (buffer, spc);
      }
  
!   for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
      {
-       tree v_must_def = V_MUST_DEF_OP (v_must_defs, i);
        pp_string (buffer, "#   V_MUST_DEF <");
!       dump_generic_node (buffer, v_must_def, spc + 2, flags, false);
        pp_string (buffer, ">;");
        newline_and_indent (buffer, spc);
      }
  
!   for (i = 0; i < NUM_VUSES (vuses); i++)
      {
-       tree vuse = VUSE_OP (vuses, i);
        pp_string (buffer, "#   VUSE <");
!       dump_generic_node (buffer, vuse, spc + 2, flags, false);
        pp_string (buffer, ">;");
        newline_and_indent (buffer, spc);
      }
--- 2036,2070 ----
  static void
  dump_vops (pretty_printer *buffer, tree stmt, int spc, int flags)
  {
!   tree use, def;
!   use_operand_p use_p;
!   def_operand_p def_p;
!   ssa_op_iter iter;
  
!   FOR_EACH_SSA_MAYDEF_OPERAND (def_p, use_p, stmt, iter)
      {
        pp_string (buffer, "#   ");
!       dump_generic_node (buffer, DEF_FROM_PTR (def_p),
                           spc + 2, flags, false);
        pp_string (buffer, " = V_MAY_DEF <");
!       dump_generic_node (buffer, USE_FROM_PTR (use_p),
                           spc + 2, flags, false);
        pp_string (buffer, ">;");
        newline_and_indent (buffer, spc);
      }
  
!   FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_VMUSTDEF)
      {
        pp_string (buffer, "#   V_MUST_DEF <");
!       dump_generic_node (buffer, def, spc + 2, flags, false);
        pp_string (buffer, ">;");
        newline_and_indent (buffer, spc);
      }
  
!   FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_VUSE)
      {
        pp_string (buffer, "#   VUSE <");
!       dump_generic_node (buffer, use, spc + 2, flags, false);
        pp_string (buffer, ">;");
        newline_and_indent (buffer, spc);
      }
Index: tree-sra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-sra.c,v
retrieving revision 2.25
diff -c -p -r2.25 tree-sra.c
*** tree-sra.c	19 Aug 2004 21:34:27 -0000	2.25
--- tree-sra.c	24 Aug 2004 14:20:28 -0000
*************** decide_instantiations (void)
*** 1397,1423 ****
  static void
  mark_all_v_defs (tree stmt)
  {
!   v_may_def_optype v_may_defs;
!   v_must_def_optype v_must_defs;
!   size_t i, n;
  
    get_stmt_operands (stmt);
  
!   v_may_defs = V_MAY_DEF_OPS (stmt_ann (stmt));
!   n = NUM_V_MAY_DEFS (v_may_defs);
!   for (i = 0; i < n; i++)
      {
-       tree sym = V_MAY_DEF_RESULT (v_may_defs, i);
-       if (TREE_CODE (sym) == SSA_NAME)
- 	sym = SSA_NAME_VAR (sym);
-       bitmap_set_bit (vars_to_rename, var_ann (sym)->uid);
-     }
- 
-   v_must_defs = V_MUST_DEF_OPS (stmt_ann (stmt));
-   n = NUM_V_MUST_DEFS (v_must_defs);
-   for (i = 0; i < n; i++)
-     {
-       tree sym = V_MUST_DEF_OP (v_must_defs, i);
        if (TREE_CODE (sym) == SSA_NAME)
  	sym = SSA_NAME_VAR (sym);
        bitmap_set_bit (vars_to_rename, var_ann (sym)->uid);
--- 1397,1409 ----
  static void
  mark_all_v_defs (tree stmt)
  {
!   tree sym;
!   ssa_op_iter iter;
  
    get_stmt_operands (stmt);
  
!   FOR_EACH_SSA_TREE_OPERAND (sym, stmt, iter, SSA_OP_VIRTUAL_DEFS)
      {
        if (TREE_CODE (sym) == SSA_NAME)
  	sym = SSA_NAME_VAR (sym);
        bitmap_set_bit (vars_to_rename, var_ann (sym)->uid);
Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.24
diff -c -p -r2.24 tree-ssa-alias.c
*** tree-ssa-alias.c	18 Aug 2004 18:21:23 -0000	2.24
--- tree-ssa-alias.c	24 Aug 2004 14:20:28 -0000
*************** compute_points_to_and_addr_escape (struc
*** 576,581 ****
--- 576,583 ----
  {
    basic_block bb;
    size_t i;
+   tree op;
+   ssa_op_iter iter;
  
    timevar_push (TV_TREE_PTA);
  
*************** compute_points_to_and_addr_escape (struc
*** 586,596 ****
  
        for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
  	{
- 	  use_optype uses;
- 	  def_optype defs;
- 	  v_may_def_optype v_may_defs;
- 	  v_must_def_optype v_must_defs;
- 	  stmt_ann_t ann;
  	  bitmap addr_taken;
  	  tree stmt = bsi_stmt (si);
  	  bool stmt_escapes_p = is_escape_site (stmt, &ai->num_calls_found);
--- 588,593 ----
*************** compute_points_to_and_addr_escape (struc
*** 629,639 ****
  		  mark_call_clobbered (var);
  		});
  
! 	  ann = stmt_ann (stmt);
! 	  uses = USE_OPS (ann);
! 	  for (i = 0; i < NUM_USES (uses); i++)
  	    {
- 	      tree op = USE_OP (uses, i);
  	      var_ann_t v_ann = var_ann (SSA_NAME_VAR (op));
  	      struct ptr_info_def *pi;
  	      bool is_store;
--- 626,633 ----
  		  mark_call_clobbered (var);
  		});
  
! 	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
  	    {
  	      var_ann_t v_ann = var_ann (SSA_NAME_VAR (op));
  	      struct ptr_info_def *pi;
  	      bool is_store;
*************** compute_points_to_and_addr_escape (struc
*** 698,707 ****
  	  /* Update reference counter for definitions to any
  	     potentially aliased variable.  This is used in the alias
  	     grouping heuristics.  */
! 	  defs = DEF_OPS (ann);
! 	  for (i = 0; i < NUM_DEFS (defs); i++)
  	    {
- 	      tree op = DEF_OP (defs, i);
  	      tree var = SSA_NAME_VAR (op);
  	      var_ann_t ann = var_ann (var);
  	      bitmap_set_bit (ai->written_vars, ann->uid);
--- 692,699 ----
  	  /* Update reference counter for definitions to any
  	     potentially aliased variable.  This is used in the alias
  	     grouping heuristics.  */
! 	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_DEF)
  	    {
  	      tree var = SSA_NAME_VAR (op);
  	      var_ann_t ann = var_ann (var);
  	      bitmap_set_bit (ai->written_vars, ann->uid);
*************** compute_points_to_and_addr_escape (struc
*** 710,734 ****
  	    }
  
  	  /* Mark variables in V_MAY_DEF operands as being written to.  */
! 	  v_may_defs = V_MAY_DEF_OPS (ann);
! 	  for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
  	    {
- 	      tree op = V_MAY_DEF_OP (v_may_defs, i);
  	      tree var = SSA_NAME_VAR (op);
  	      var_ann_t ann = var_ann (var);
  	      bitmap_set_bit (ai->written_vars, ann->uid);
  	    }
  	    
- 	  /* Mark variables in V_MUST_DEF operands as being written to.  */
- 	  v_must_defs = V_MUST_DEF_OPS (ann);
- 	  for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
- 	    {
- 	      tree op = V_MUST_DEF_OP (v_must_defs, i);
- 	      tree var = SSA_NAME_VAR (op);
- 	      var_ann_t ann = var_ann (var);
- 	      bitmap_set_bit (ai->written_vars, ann->uid);
- 	    }
- 
  	  /* After promoting variables and computing aliasing we will
  	     need to re-scan most statements.  FIXME: Try to minimize the
  	     number of statements re-scanned.  It's not really necessary to
--- 702,714 ----
  	    }
  
  	  /* Mark variables in V_MAY_DEF operands as being written to.  */
! 	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_VIRTUAL_DEFS)
  	    {
  	      tree var = SSA_NAME_VAR (op);
  	      var_ann_t ann = var_ann (var);
  	      bitmap_set_bit (ai->written_vars, ann->uid);
  	    }
  	    
  	  /* After promoting variables and computing aliasing we will
  	     need to re-scan most statements.  FIXME: Try to minimize the
  	     number of statements re-scanned.  It's not really necessary to
*************** dump_points_to_info (FILE *file)
*** 2391,2396 ****
--- 2371,2377 ----
    basic_block bb;
    block_stmt_iterator si;
    size_t i;
+   ssa_op_iter iter;
    const char *fname =
      lang_hooks.decl_printable_name (current_function_decl, 2);
  
*************** dump_points_to_info (FILE *file)
*** 2424,2435 ****
  
  	for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
  	  {
! 	    stmt_ann_t ann = stmt_ann (bsi_stmt (si));
! 	    def_optype defs = DEF_OPS (ann);
! 	    if (defs)
! 	      for (i = 0; i < NUM_DEFS (defs); i++)
! 		if (POINTER_TYPE_P (TREE_TYPE (DEF_OP (defs, i))))
! 		  dump_points_to_info_for (file, DEF_OP (defs, i));
  	  }
      }
  
--- 2405,2415 ----
  
  	for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
  	  {
! 	    tree stmt = bsi_stmt (si);
! 	    tree def;
! 	    FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF)
! 	      if (POINTER_TYPE_P (TREE_TYPE (def)))
! 		dump_points_to_info_for (file, def);
  	  }
      }
  
Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-ccp.c,v
retrieving revision 2.31
diff -c -p -r2.31 tree-ssa-ccp.c
*** tree-ssa-ccp.c	15 Aug 2004 15:45:00 -0000	2.31
--- tree-ssa-ccp.c	24 Aug 2004 14:20:29 -0000
*************** cp_lattice_meet (value val1, value val2)
*** 644,654 ****
  static void
  visit_stmt (tree stmt)
  {
-   size_t i;
    stmt_ann_t ann;
-   def_optype defs;
    v_may_def_optype v_may_defs;
    v_must_def_optype v_must_defs;
  
    /* If the statement has already been deemed to be VARYING, don't simulate
       it again.  */
--- 644,654 ----
  static void
  visit_stmt (tree stmt)
  {
    stmt_ann_t ann;
    v_may_def_optype v_may_defs;
    v_must_def_optype v_must_defs;
+   tree def;
+   ssa_op_iter iter;
  
    /* If the statement has already been deemed to be VARYING, don't simulate
       it again.  */
*************** visit_stmt (tree stmt)
*** 684,695 ****
  
    /* Definitions made by statements other than assignments to SSA_NAMEs
       represent unknown modifications to their outputs.  Mark them VARYING.  */
!   else if (NUM_DEFS (defs = DEF_OPS (ann)) != 0)
      {
        DONT_SIMULATE_AGAIN (stmt) = 1;
!       for (i = 0; i < NUM_DEFS (defs); i++)
  	{
- 	  tree def = DEF_OP (defs, i);
  	  def_to_varying (def);
  	}
      }
--- 684,694 ----
  
    /* Definitions made by statements other than assignments to SSA_NAMEs
       represent unknown modifications to their outputs.  Mark them VARYING.  */
!   else if (NUM_DEFS (DEF_OPS (ann)) != 0)
      {
        DONT_SIMULATE_AGAIN (stmt) = 1;
!       FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF)
  	{
  	  def_to_varying (def);
  	}
      }
*************** visit_stmt (tree stmt)
*** 712,720 ****
      }
  
    /* Mark all V_MAY_DEF operands VARYING.  */
!   v_may_defs = V_MAY_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
!     def_to_varying (V_MAY_DEF_RESULT (v_may_defs, i));
      
  }
  
--- 711,718 ----
      }
  
    /* Mark all V_MAY_DEF operands VARYING.  */
!   FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_VMAYDEF)
!     def_to_varying (def);
      
  }
  
*************** initialize (void)
*** 1187,1192 ****
--- 1185,1192 ----
    edge e;
    basic_block bb;
    sbitmap virtual_var;
+   tree def;
+   ssa_op_iter iter;
  
    /* Worklists of SSA edges.  */
    VARRAY_TREE_INIT (ssa_edges, 20, "ssa_edges");
*************** initialize (void)
*** 1211,1221 ****
      {
        block_stmt_iterator i;
        tree stmt;
-       stmt_ann_t ann;
-       def_optype defs;
-       v_may_def_optype v_may_defs;
-       v_must_def_optype v_must_defs;
-       size_t x;
        int vary;
  
        /* Get the default value for each definition.  */
--- 1211,1216 ----
*************** initialize (void)
*** 1224,1256 ****
  	  vary = 0;
  	  stmt = bsi_stmt (i);
  	  get_stmt_operands (stmt);
! 	  ann = stmt_ann (stmt);
! 	  defs = DEF_OPS (ann);
! 	  for (x = 0; x < NUM_DEFS (defs); x++)
  	    {
- 	      tree def = DEF_OP (defs, x);
  	      if (get_value (def)->lattice_val == VARYING)
  		vary = 1;
  	    }
  	  
- 	  /* Get the default value for each V_MUST_DEF.  */
- 	  v_must_defs = V_MUST_DEF_OPS (ann);
- 	  for (x = 0; x < NUM_V_MUST_DEFS (v_must_defs); x++)
- 	    {
- 	      tree v_must_def = V_MUST_DEF_OP (v_must_defs, x);
- 	      if (get_value (v_must_def)->lattice_val == VARYING)
- 	        vary = 1;
- 	    }
- 	  
  	  DONT_SIMULATE_AGAIN (stmt) = vary;
  
  	  /* Mark all V_MAY_DEF operands VARYING.  */
! 	  v_may_defs = V_MAY_DEF_OPS (ann);
! 	  for (x = 0; x < NUM_V_MAY_DEFS (v_may_defs); x++)
  	    {
! 	      tree res = V_MAY_DEF_RESULT (v_may_defs, x);
! 	      get_value (res)->lattice_val = VARYING;
! 	      SET_BIT (virtual_var, SSA_NAME_VERSION (res));
  	    }
  	}
  
--- 1219,1240 ----
  	  vary = 0;
  	  stmt = bsi_stmt (i);
  	  get_stmt_operands (stmt);
! 
! 	  /* Get the default value for each DEF and V_MUST_DEF.  */
! 	  FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, 
! 				     (SSA_OP_DEF | SSA_OP_VMUSTDEF))
  	    {
  	      if (get_value (def)->lattice_val == VARYING)
  		vary = 1;
  	    }
  	  
  	  DONT_SIMULATE_AGAIN (stmt) = vary;
  
  	  /* Mark all V_MAY_DEF operands VARYING.  */
! 	  FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_VMAYDEF)
  	    {
! 	      get_value (def)->lattice_val = VARYING;
! 	      SET_BIT (virtual_var, SSA_NAME_VERSION (def));
  	    }
  	}
  
*************** static bool
*** 1494,1511 ****
  replace_uses_in (tree stmt, bool *replaced_addresses_p)
  {
    bool replaced = false;
!   use_optype uses;
!   size_t i;
  
    if (replaced_addresses_p)
      *replaced_addresses_p = false;
  
    get_stmt_operands (stmt);
  
!   uses = STMT_USE_OPS (stmt);
!   for (i = 0; i < NUM_USES (uses); i++)
      {
-       use_operand_p use = USE_OP_PTR (uses, i);
        value *val = get_value (USE_FROM_PTR (use));
  
        if (val->lattice_val == CONSTANT)
--- 1478,1493 ----
  replace_uses_in (tree stmt, bool *replaced_addresses_p)
  {
    bool replaced = false;
!   use_operand_p use;
!   ssa_op_iter iter;
  
    if (replaced_addresses_p)
      *replaced_addresses_p = false;
  
    get_stmt_operands (stmt);
  
!   FOR_EACH_SSA_USE_OPERAND (use, stmt, iter, SSA_OP_USE)
      {
        value *val = get_value (USE_FROM_PTR (use));
  
        if (val->lattice_val == CONSTANT)
*************** replace_vuse_in (tree stmt, bool *replac
*** 1575,1585 ****
  static latticevalue
  likely_value (tree stmt)
  {
-   use_optype uses;
    vuse_optype vuses;
-   size_t i;
    int found_constant = 0;
    stmt_ann_t ann;
  
    /* If the statement makes aliased loads or has volatile operands, it
       won't fold to a constant value.  */
--- 1557,1567 ----
  static latticevalue
  likely_value (tree stmt)
  {
    vuse_optype vuses;
    int found_constant = 0;
    stmt_ann_t ann;
+   tree use;
+   ssa_op_iter iter;
  
    /* If the statement makes aliased loads or has volatile operands, it
       won't fold to a constant value.  */
*************** likely_value (tree stmt)
*** 1594,1603 ****
  
    get_stmt_operands (stmt);
  
!   uses = USE_OPS (ann);
!   for (i = 0; i < NUM_USES (uses); i++)
      {
-       tree use = USE_OP (uses, i);
        value *val = get_value (use);
  
        if (val->lattice_val == UNDEFINED)
--- 1576,1583 ----
  
    get_stmt_operands (stmt);
  
!   FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
      {
        value *val = get_value (use);
  
        if (val->lattice_val == UNDEFINED)
*************** likely_value (tree stmt)
*** 1627,1633 ****
  	found_constant = 1;
      }
  
!   return ((found_constant || (!uses && !vuses)) ? CONSTANT : VARYING);
  }
  
  /* A subroutine of fold_stmt_r.  Attempts to fold *(A+O) to A[X].
--- 1607,1613 ----
  	found_constant = 1;
      }
  
!   return ((found_constant || (!USE_OPS (ann) && !vuses)) ? CONSTANT : VARYING);
  }
  
  /* A subroutine of fold_stmt_r.  Attempts to fold *(A+O) to A[X].
*************** set_rhs (tree *stmt_p, tree expr)
*** 2266,2271 ****
--- 2246,2253 ----
    tree stmt = *stmt_p, op;
    enum tree_code code = TREE_CODE (expr);
    stmt_ann_t ann;
+   tree var;
+   ssa_op_iter iter;
  
    /* Verify the constant folded result is valid gimple.  */
    if (TREE_CODE_CLASS (code) == '2')
*************** set_rhs (tree *stmt_p, tree expr)
*** 2321,2353 ****
  
        if (TREE_SIDE_EFFECTS (expr))
  	{
- 	  def_optype defs;
- 	  v_may_def_optype v_may_defs;
- 	  v_must_def_optype v_must_defs;
- 	  size_t i;
- 
  	  /* Fix all the SSA_NAMEs created by *STMT_P to point to its new
  	     replacement.  */
! 	  defs = DEF_OPS (ann);
! 	  for (i = 0; i < NUM_DEFS (defs); i++)
! 	    {
! 	      tree var = DEF_OP (defs, i);
! 	      if (TREE_CODE (var) == SSA_NAME)
! 		SSA_NAME_DEF_STMT (var) = *stmt_p;
! 	    }
! 
! 	  v_may_defs = V_MAY_DEF_OPS (ann);
! 	  for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
! 	    {
! 	      tree var = V_MAY_DEF_RESULT (v_may_defs, i);
! 	      if (TREE_CODE (var) == SSA_NAME)
! 		SSA_NAME_DEF_STMT (var) = *stmt_p;
! 	    }
! 	    
! 	  v_must_defs = V_MUST_DEF_OPS (ann);
! 	  for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
  	    {
- 	      tree var = V_MUST_DEF_OP (v_must_defs, i);
  	      if (TREE_CODE (var) == SSA_NAME)
  		SSA_NAME_DEF_STMT (var) = *stmt_p;
  	    }
--- 2303,2312 ----
  
        if (TREE_SIDE_EFFECTS (expr))
  	{
  	  /* Fix all the SSA_NAMEs created by *STMT_P to point to its new
  	     replacement.  */
! 	  FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_DEFS)
  	    {
  	      if (TREE_CODE (var) == SSA_NAME)
  		SSA_NAME_DEF_STMT (var) = *stmt_p;
  	    }
Index: tree-ssa-dce.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dce.c,v
retrieving revision 2.12
diff -c -p -r2.12 tree-ssa-dce.c
*** tree-ssa-dce.c	12 Aug 2004 14:33:59 -0000	2.12
--- tree-ssa-dce.c	24 Aug 2004 14:20:29 -0000
*************** mark_operand_necessary (tree op)
*** 276,287 ****
  static void
  mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
  {
-   def_optype defs;
    v_may_def_optype v_may_defs;
    v_must_def_optype v_must_defs;
    stmt_ann_t ann;
!   size_t i;
!   tree op;
  
    /* Statements that are implicitly live.  Most function calls, asm and return
       statements are required.  Labels and BIND_EXPR nodes are kept because
--- 276,286 ----
  static void
  mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
  {
    v_may_def_optype v_may_defs;
    v_must_def_optype v_must_defs;
    stmt_ann_t ann;
!   tree op, def;
!   ssa_op_iter iter;
  
    /* Statements that are implicitly live.  Most function calls, asm and return
       statements are required.  Labels and BIND_EXPR nodes are kept because
*************** mark_stmt_if_obviously_necessary (tree s
*** 370,379 ****
  
    get_stmt_operands (stmt);
  
!   defs = DEF_OPS (ann);
!   for (i = 0; i < NUM_DEFS (defs); i++)
      {
-       tree def = DEF_OP (defs, i);
        if (is_global_var (SSA_NAME_VAR (def)))
  	{
  	  mark_stmt_necessary (stmt, true);
--- 369,376 ----
  
    get_stmt_operands (stmt);
  
!   FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF)
      {
        if (is_global_var (SSA_NAME_VAR (def)))
  	{
  	  mark_stmt_necessary (stmt, true);
*************** propagate_necessity (struct edge_list *e
*** 627,656 ****
  	  /* Propagate through the operands.  Examine all the USE, VUSE and
  	     V_MAY_DEF operands in this statement.  Mark all the statements 
  	     which feed this statement's uses as necessary.  */
! 	  vuse_optype vuses;
! 	  v_may_def_optype v_may_defs;
! 	  use_optype uses;
! 	  stmt_ann_t ann;
! 	  size_t k;
  
  	  get_stmt_operands (i);
- 	  ann = stmt_ann (i);
- 
- 	  uses = USE_OPS (ann);
- 	  for (k = 0; k < NUM_USES (uses); k++)
- 	    mark_operand_necessary (USE_OP (uses, k));
- 
- 	  vuses = VUSE_OPS (ann);
- 	  for (k = 0; k < NUM_VUSES (vuses); k++)
- 	    mark_operand_necessary (VUSE_OP (vuses, k));
  
  	  /* The operands of V_MAY_DEF expressions are also needed as they
  	     represent potential definitions that may reach this
  	     statement (V_MAY_DEF operands allow us to follow def-def 
  	     links).  */
! 	  v_may_defs = V_MAY_DEF_OPS (ann);
! 	  for (k = 0; k < NUM_V_MAY_DEFS (v_may_defs); k++)
! 	    mark_operand_necessary (V_MAY_DEF_OP (v_may_defs, k));
  	}
      }
  }
--- 624,641 ----
  	  /* Propagate through the operands.  Examine all the USE, VUSE and
  	     V_MAY_DEF operands in this statement.  Mark all the statements 
  	     which feed this statement's uses as necessary.  */
! 	  ssa_op_iter iter;
! 	  tree use;
  
  	  get_stmt_operands (i);
  
  	  /* The operands of V_MAY_DEF expressions are also needed as they
  	     represent potential definitions that may reach this
  	     statement (V_MAY_DEF operands allow us to follow def-def 
  	     links).  */
! 
! 	  FOR_EACH_SSA_TREE_OPERAND (use, i, iter, SSA_OP_ALL_USES)
! 	    mark_operand_necessary (use);
  	}
      }
  }
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
retrieving revision 2.32
diff -c -p -r2.32 tree-ssa-dom.c
*** tree-ssa-dom.c	15 Aug 2004 15:45:01 -0000	2.32
--- tree-ssa-dom.c	24 Aug 2004 14:20:29 -0000
*************** static void restore_vars_to_original_val
*** 253,259 ****
  					    varray_type table);
  static void restore_currdefs_to_original_value (varray_type locals,
  						unsigned limit);
! static void register_definitions_for_stmt (stmt_ann_t, varray_type *);
  static edge single_incoming_edge_ignoring_loop_edges (basic_block);
  
  /* Local version of fold that doesn't introduce cruft.  */
--- 253,259 ----
  					    varray_type table);
  static void restore_currdefs_to_original_value (varray_type locals,
  						unsigned limit);
! static void register_definitions_for_stmt (tree, varray_type *);
  static edge single_incoming_edge_ignoring_loop_edges (basic_block);
  
  /* Local version of fold that doesn't introduce cruft.  */
*************** static bool
*** 2698,2738 ****
  cprop_into_stmt (tree stmt, varray_type const_and_copies)
  {
    bool may_have_exposed_new_symbols = false;
!   stmt_ann_t ann = stmt_ann (stmt);
!   size_t i, num_uses, num_vuses, num_v_may_defs;
!   vuse_optype vuses;
!   v_may_def_optype v_may_defs;
!   use_optype uses;
! 
!   uses = USE_OPS (ann);
!   num_uses = NUM_USES (uses);
!   for (i = 0; i < num_uses; i++)
!     {
!       use_operand_p op_p = USE_OP_PTR (uses, i);
!       if (TREE_CODE (USE_FROM_PTR (op_p)) == SSA_NAME)
! 	may_have_exposed_new_symbols
! 	  |= cprop_operand (stmt, op_p, const_and_copies);
!     }
  
!   vuses = VUSE_OPS (ann);
!   num_vuses = NUM_VUSES (vuses);
!   for (i = 0; i < num_vuses; i++)
      {
-       use_operand_p op_p = VUSE_OP_PTR (vuses, i);
        if (TREE_CODE (USE_FROM_PTR (op_p)) == SSA_NAME)
  	may_have_exposed_new_symbols
  	  |= cprop_operand (stmt, op_p, const_and_copies);
      }
  
-   v_may_defs = V_MAY_DEF_OPS (ann);
-   num_v_may_defs = NUM_V_MAY_DEFS (v_may_defs);
-   for (i = 0; i < num_v_may_defs; i++)
-     {
-       use_operand_p op_p = V_MAY_DEF_OP_PTR (v_may_defs, i);
-       if (TREE_CODE (USE_FROM_PTR (op_p)) == SSA_NAME)
- 	may_have_exposed_new_symbols
- 	  |= cprop_operand (stmt, op_p, const_and_copies);
-     }
    return may_have_exposed_new_symbols;
  }
  
--- 2698,2713 ----
  cprop_into_stmt (tree stmt, varray_type const_and_copies)
  {
    bool may_have_exposed_new_symbols = false;
!   use_operand_p op_p;
!   ssa_op_iter iter;
  
!   FOR_EACH_SSA_USE_OPERAND (op_p, stmt, iter, SSA_OP_ALL_USES)
      {
        if (TREE_CODE (USE_FROM_PTR (op_p)) == SSA_NAME)
  	may_have_exposed_new_symbols
  	  |= cprop_operand (stmt, op_p, const_and_copies);
      }
  
    return may_have_exposed_new_symbols;
  }
  
*************** optimize_stmt (struct dom_walk_data *wal
*** 2830,2836 ****
  				   may_optimize_p,
  				   ann);
  
!   register_definitions_for_stmt (ann, &bd->block_defs);
  
    /* If STMT is a COND_EXPR and it was modified, then we may know
       where it goes.  If that is the case, then mark the CFG as altered.
--- 2805,2811 ----
  				   may_optimize_p,
  				   ann);
  
!   register_definitions_for_stmt (stmt, &bd->block_defs);
  
    /* If STMT is a COND_EXPR and it was modified, then we may know
       where it goes.  If that is the case, then mark the CFG as altered.
*************** avail_expr_eq (const void *p1, const voi
*** 3373,3411 ****
     and CURRDEFS.  */
  
  static void
! register_definitions_for_stmt (stmt_ann_t ann, varray_type *block_defs_p)
  {
!   def_optype defs;
!   v_may_def_optype v_may_defs;
!   v_must_def_optype v_must_defs;
!   unsigned int i;
  
!   defs = DEF_OPS (ann);
!   for (i = 0; i < NUM_DEFS (defs); i++)
      {
-       tree def = DEF_OP (defs, i);
  
        /* FIXME: We shouldn't be registering new defs if the variable
  	 doesn't need to be renamed.  */
        register_new_def (def, block_defs_p);
      }
- 
-   /* Register new virtual definitions made by the statement.  */
-   v_may_defs = V_MAY_DEF_OPS (ann);
-   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
-     {
-       /* FIXME: We shouldn't be registering new defs if the variable
- 	 doesn't need to be renamed.  */
-       register_new_def (V_MAY_DEF_RESULT (v_may_defs, i), block_defs_p);
-     }
-     
-   /* Register new virtual mustdefs made by the statement.  */
-   v_must_defs = V_MUST_DEF_OPS (ann);
-   for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
-     {
-       /* FIXME: We shouldn't be registering new defs if the variable
- 	 doesn't need to be renamed.  */
-       register_new_def (V_MUST_DEF_OP (v_must_defs, i), block_defs_p);
-     }
  }
  
--- 3348,3364 ----
     and CURRDEFS.  */
  
  static void
! register_definitions_for_stmt (tree stmt, varray_type *block_defs_p)
  {
!   tree def;
!   ssa_op_iter iter;
  
!   FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS)
      {
  
        /* FIXME: We shouldn't be registering new defs if the variable
  	 doesn't need to be renamed.  */
        register_new_def (def, block_defs_p);
      }
  }
  
Index: tree-ssa-live.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-live.c,v
retrieving revision 2.15
diff -c -p -r2.15 tree-ssa-live.c
*** tree-ssa-live.c	18 Aug 2004 07:46:23 -0000	2.15
--- tree-ssa-live.c	24 Aug 2004 14:20:30 -0000
*************** create_ssa_var_map (int flags)
*** 325,340 ****
    tree dest, use;
    tree stmt;
    stmt_ann_t ann;
-   use_optype uses;
-   def_optype defs;
-   unsigned x;
    var_map map;
  #ifdef ENABLE_CHECKING
    sbitmap used_in_real_ops;
    sbitmap used_in_virtual_ops;
-   vuse_optype vuses;
-   v_may_def_optype v_may_defs;
-   v_must_def_optype v_must_defs;
  #endif
  
    map = init_var_map (num_ssa_names + 1);
--- 325,335 ----
    tree dest, use;
    tree stmt;
    stmt_ann_t ann;
    var_map map;
+   ssa_op_iter iter;
  #ifdef ENABLE_CHECKING
    sbitmap used_in_real_ops;
    sbitmap used_in_virtual_ops;
  #endif
  
    map = init_var_map (num_ssa_names + 1);
*************** create_ssa_var_map (int flags)
*** 378,387 ****
  	  ann = stmt_ann (stmt);
  
  	  /* Register USE and DEF operands in each statement.  */
! 	  uses = USE_OPS (ann);
! 	  for (x = 0; x < NUM_USES (uses); x++)
  	    {
- 	      use = USE_OP (uses, x);
  	      register_ssa_partition (map, use, true);
  
  #ifdef ENABLE_CHECKING
--- 373,380 ----
  	  ann = stmt_ann (stmt);
  
  	  /* Register USE and DEF operands in each statement.  */
! 	  FOR_EACH_SSA_TREE_OPERAND (use , stmt, iter, SSA_OP_USE)
  	    {
  	      register_ssa_partition (map, use, true);
  
  #ifdef ENABLE_CHECKING
*************** create_ssa_var_map (int flags)
*** 389,398 ****
  #endif
  	    }
  
! 	  defs = DEF_OPS (ann);
! 	  for (x = 0; x < NUM_DEFS (defs); x++)
  	    {
- 	      dest = DEF_OP (defs, x);
  	      register_ssa_partition (map, dest, false);
  
  #ifdef ENABLE_CHECKING
--- 382,389 ----
  #endif
  	    }
  
! 	  FOR_EACH_SSA_TREE_OPERAND (dest, stmt, iter, SSA_OP_DEF)
  	    {
  	      register_ssa_partition (map, dest, false);
  
  #ifdef ENABLE_CHECKING
*************** create_ssa_var_map (int flags)
*** 402,427 ****
  
  #ifdef ENABLE_CHECKING
  	  /* Validate that virtual ops don't get used in funny ways.  */
! 	  vuses = VUSE_OPS (ann);
! 	  for (x = 0; x < NUM_VUSES (vuses); x++)
  	    {
! 	      tree var = VUSE_OP (vuses, x);
! 	      SET_BIT (used_in_virtual_ops, var_ann (SSA_NAME_VAR (var))->uid);
  	    }
  
- 	  v_may_defs = V_MAY_DEF_OPS (ann);
- 	  for (x = 0; x < NUM_V_MAY_DEFS (v_may_defs); x++)
- 	    {
- 	      tree var = V_MAY_DEF_OP (v_may_defs, x);
- 	      SET_BIT (used_in_virtual_ops, var_ann (SSA_NAME_VAR (var))->uid);
- 	    }
- 	    
- 	  v_must_defs = V_MUST_DEF_OPS (ann);
- 	  for (x = 0; x < NUM_V_MUST_DEFS (v_must_defs); x++)
- 	    {
- 	      tree var = V_MUST_DEF_OP (v_must_defs, x);
- 	      SET_BIT (used_in_virtual_ops, var_ann (SSA_NAME_VAR (var))->uid);
- 	    }	    
  #endif /* ENABLE_CHECKING */
  
  	  mark_all_vars_used (bsi_stmt_ptr (bsi));
--- 393,404 ----
  
  #ifdef ENABLE_CHECKING
  	  /* Validate that virtual ops don't get used in funny ways.  */
! 	  FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, 
! 				     SSA_OP_VIRTUAL_USES | SSA_OP_VMUSTDEF)
  	    {
! 	      SET_BIT (used_in_virtual_ops, var_ann (SSA_NAME_VAR (use))->uid);
  	    }
  
  #endif /* ENABLE_CHECKING */
  
  	  mark_all_vars_used (bsi_stmt_ptr (bsi));
*************** tree_live_info_p 
*** 579,585 ****
  calculate_live_on_entry (var_map map)
  {
    tree_live_info_p live;
!   int num, i;
    basic_block bb;
    bitmap saw_def;
    tree phi, var, stmt;
--- 556,562 ----
  calculate_live_on_entry (var_map map)
  {
    tree_live_info_p live;
!   int i;
    basic_block bb;
    bitmap saw_def;
    tree phi, var, stmt;
*************** calculate_live_on_entry (var_map map)
*** 587,595 ****
    edge e;
    varray_type stack;
    block_stmt_iterator bsi;
-   use_optype uses;
-   def_optype defs;
    stmt_ann_t ann;
  
    saw_def = BITMAP_XMALLOC ();
  
--- 564,575 ----
    edge e;
    varray_type stack;
    block_stmt_iterator bsi;
    stmt_ann_t ann;
+   ssa_op_iter iter;
+ #ifdef ENABLE_CHECKING
+   int num;
+ #endif
+ 
  
    saw_def = BITMAP_XMALLOC ();
  
*************** calculate_live_on_entry (var_map map)
*** 636,654 ****
  	  get_stmt_operands (stmt);
  	  ann = stmt_ann (stmt);
  
! 	  uses = USE_OPS (ann);
! 	  num = NUM_USES (uses);
! 	  for (i = 0; i < num; i++)
  	    {
- 	      op = USE_OP (uses, i);
  	      add_livein_if_notdef (live, saw_def, op, bb);
  	    }
  
! 	  defs = DEF_OPS (ann);
! 	  num = NUM_DEFS (defs);
! 	  for (i = 0; i < num; i++)
  	    {
- 	      op = DEF_OP (defs, i);
  	      set_if_valid (map, saw_def, op);
  	    }
  	}
--- 616,628 ----
  	  get_stmt_operands (stmt);
  	  ann = stmt_ann (stmt);
  
! 	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
  	    {
  	      add_livein_if_notdef (live, saw_def, op, bb);
  	    }
  
! 	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_DEF)
  	    {
  	      set_if_valid (map, saw_def, op);
  	    }
  	}
*************** build_tree_conflict_graph (tree_live_inf
*** 1332,1343 ****
    conflict_graph graph;
    var_map map;
    bitmap live;
!   int num, x, y, i;
    basic_block bb;
    varray_type partition_link, tpa_to_clear, tpa_nodes;
-   def_optype defs;
-   use_optype uses;
    unsigned l;
  
    map = live_var_map (liveinfo);
    graph = conflict_graph_new (num_var_partitions (map));
--- 1306,1316 ----
    conflict_graph graph;
    var_map map;
    bitmap live;
!   int x, y, i;
    basic_block bb;
    varray_type partition_link, tpa_to_clear, tpa_nodes;
    unsigned l;
+   ssa_op_iter iter;
  
    map = live_var_map (liveinfo);
    graph = conflict_graph_new (num_var_partitions (map));
*************** build_tree_conflict_graph (tree_live_inf
*** 1415,1434 ****
  	  if (!is_a_copy)
  	    {
  	      tree var;
! 
! 	      defs = DEF_OPS (ann);
! 	      num = NUM_DEFS (defs);
! 	      for (x = 0; x < num; x++)
  		{
- 		  var = DEF_OP (defs, x);
  		  add_conflicts_if_valid (tpa, graph, map, live, var);
  		}
  
! 	      uses = USE_OPS (ann);
! 	      num = NUM_USES (uses);
! 	      for (x = 0; x < num; x++)
  		{
- 		  var = USE_OP (uses, x);
  		  set_if_valid (map, live, var);
  		}
  	    }
--- 1388,1400 ----
  	  if (!is_a_copy)
  	    {
  	      tree var;
! 	      FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_DEF)
  		{
  		  add_conflicts_if_valid (tpa, graph, map, live, var);
  		}
  
! 	      FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_USE)
  		{
  		  set_if_valid (map, live, var);
  		}
  	    }
Index: tree-ssa-loop-im.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-im.c,v
retrieving revision 2.6
diff -c -p -r2.6 tree-ssa-loop-im.c
*** tree-ssa-loop-im.c	23 Aug 2004 08:17:20 -0000	2.6
--- tree-ssa-loop-im.c	24 Aug 2004 14:20:30 -0000
*************** determine_max_movement (tree stmt, bool 
*** 406,416 ****
    struct loop *loop = bb->loop_father;
    struct loop *level;
    struct lim_aux_data *lim_data = LIM_DATA (stmt);
!   use_optype uses;
!   vuse_optype vuses;
!   v_may_def_optype v_may_defs;
!   stmt_ann_t ann = stmt_ann (stmt);
!   unsigned i;
    
    if (must_preserve_exec)
      level = ALWAYS_EXECUTED_IN (bb);
--- 406,413 ----
    struct loop *loop = bb->loop_father;
    struct loop *level;
    struct lim_aux_data *lim_data = LIM_DATA (stmt);
!   tree val;
!   ssa_op_iter iter;
    
    if (must_preserve_exec)
      level = ALWAYS_EXECUTED_IN (bb);
*************** determine_max_movement (tree stmt, bool 
*** 418,436 ****
      level = superloop_at_depth (loop, 1);
    lim_data->max_loop = level;
  
!   uses = USE_OPS (ann);
!   for (i = 0; i < NUM_USES (uses); i++)
!     if (!add_dependency (USE_OP (uses, i), lim_data, loop, true))
!       return false;
! 
!   vuses = VUSE_OPS (ann);
!   for (i = 0; i < NUM_VUSES (vuses); i++)
!     if (!add_dependency (VUSE_OP (vuses, i), lim_data, loop, false))
        return false;
  
!   v_may_defs = V_MAY_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
!     if (!add_dependency (V_MAY_DEF_OP (v_may_defs, i), lim_data, loop, false))
        return false;
  
    lim_data->cost += stmt_cost (stmt);
--- 415,426 ----
      level = superloop_at_depth (loop, 1);
    lim_data->max_loop = level;
  
!   FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter, SSA_OP_USE)
!     if (!add_dependency (val, lim_data, loop, true))
        return false;
  
!   FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter, SSA_OP_VIRTUAL_USES)
!     if (!add_dependency (val, lim_data, loop, false))
        return false;
  
    lim_data->cost += stmt_cost (stmt);
*************** single_reachable_address (struct loop *l
*** 926,935 ****
    unsigned in_queue = 1;
    dataflow_t df;
    unsigned i, n;
-   v_may_def_optype v_may_defs;
-   vuse_optype vuses;
    struct sra_data sra_data;
    tree call;
  
    sbitmap_zero (seen);
  
--- 916,925 ----
    unsigned in_queue = 1;
    dataflow_t df;
    unsigned i, n;
    struct sra_data sra_data;
    tree call;
+   tree val;
+   ssa_op_iter iter;
  
    sbitmap_zero (seen);
  
*************** single_reachable_address (struct loop *l
*** 970,984 ****
  
  	  /* Traverse also definitions of the VUSES (there may be other
  	     distinct from the one we used to get to this statement).  */
! 	  v_may_defs = STMT_V_MAY_DEF_OPS (stmt);
! 	  for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
! 	    maybe_queue_var (V_MAY_DEF_OP (v_may_defs, i), loop,
! 			     seen, queue, &in_queue);
  
- 	  vuses = STMT_VUSE_OPS (stmt);
- 	  for (i = 0; i < NUM_VUSES (vuses); i++)
- 	    maybe_queue_var (VUSE_OP (vuses, i), loop,
- 			     seen, queue, &in_queue);
  	  break;
  
  	case PHI_NODE:
--- 960,968 ----
  
  	  /* Traverse also definitions of the VUSES (there may be other
  	     distinct from the one we used to get to this statement).  */
! 	  FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter, SSA_OP_VIRTUAL_USES)
! 	    maybe_queue_var (val, loop, seen, queue, &in_queue);
  
  	  break;
  
  	case PHI_NODE:
*************** fail:
*** 1029,1060 ****
  static void
  rewrite_mem_refs (tree tmp_var, struct mem_ref *mem_refs)
  {
-   v_may_def_optype v_may_defs;
-   v_must_def_optype v_must_defs;
-   vuse_optype vuses;
-   unsigned i;
    tree var;
  
    for (; mem_refs; mem_refs = mem_refs->next)
      {
!       v_may_defs = STMT_V_MAY_DEF_OPS (mem_refs->stmt);
!       for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
! 	{
! 	  var = SSA_NAME_VAR (V_MAY_DEF_RESULT (v_may_defs, i));
! 	  bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
! 	}
! 
!       v_must_defs = STMT_V_MUST_DEF_OPS (mem_refs->stmt);
!       for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
! 	{
! 	  var = SSA_NAME_VAR (V_MUST_DEF_OP (v_must_defs, i));
! 	  bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
! 	}
! 
!       vuses = STMT_VUSE_OPS (mem_refs->stmt);
!       for (i = 0; i < NUM_VUSES (vuses); i++)
  	{
! 	  var = SSA_NAME_VAR (VUSE_OP (vuses, i));
  	  bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
  	}
  
--- 1013,1027 ----
  static void
  rewrite_mem_refs (tree tmp_var, struct mem_ref *mem_refs)
  {
    tree var;
+   ssa_op_iter iter;
  
    for (; mem_refs; mem_refs = mem_refs->next)
      {
!       FOR_EACH_SSA_TREE_OPERAND (var, mem_refs->stmt, iter,
! 				 (SSA_OP_VIRTUAL_DEFS | SSA_OP_VUSE))
  	{
! 	  var = SSA_NAME_VAR (var);
  	  bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
  	}
  
Index: tree-ssa-loop-manip.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-manip.c,v
retrieving revision 2.1
diff -c -p -r2.1 tree-ssa-loop-manip.c
*** tree-ssa-loop-manip.c	5 Aug 2004 21:33:21 -0000	2.1
--- tree-ssa-loop-manip.c	24 Aug 2004 14:20:30 -0000
*************** find_uses_to_rename_use (basic_block bb,
*** 165,191 ****
  static void
  find_uses_to_rename_stmt (tree stmt, bitmap *use_blocks)
  {
!   use_optype uses;
!   vuse_optype vuses;
!   v_may_def_optype v_may_defs;
!   stmt_ann_t ann;
!   unsigned i;
    basic_block bb = bb_for_stmt (stmt);
  
    get_stmt_operands (stmt);
-   ann = stmt_ann (stmt);
  
!   uses = USE_OPS (ann);
!   for (i = 0; i < NUM_USES (uses); i++)
!     find_uses_to_rename_use (bb, USE_OP (uses, i), use_blocks);
! 
!   vuses = VUSE_OPS (ann);
!   for (i = 0; i < NUM_VUSES (vuses); i++)
!     find_uses_to_rename_use (bb, VUSE_OP (vuses, i),use_blocks);
! 
!   v_may_defs = V_MAY_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
!     find_uses_to_rename_use (bb, V_MAY_DEF_OP (v_may_defs, i), use_blocks);
  }
  
  /* Marks names that are used outside of the loop they are defined in
--- 165,178 ----
  static void
  find_uses_to_rename_stmt (tree stmt, bitmap *use_blocks)
  {
!   ssa_op_iter iter;
!   tree var;
    basic_block bb = bb_for_stmt (stmt);
  
    get_stmt_operands (stmt);
  
!   FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_USES)
!     find_uses_to_rename_use (bb, var, use_blocks);
  }
  
  /* Marks names that are used outside of the loop they are defined in
*************** check_loop_closed_ssa_use (basic_block b
*** 292,317 ****
  static void
  check_loop_closed_ssa_stmt (basic_block bb, tree stmt)
  {
!   use_optype uses;
!   vuse_optype vuses;
!   v_may_def_optype v_may_defs;
!   stmt_ann_t ann;
!   unsigned i;
  
    get_stmt_operands (stmt);
-   ann = stmt_ann (stmt);
  
!   uses = USE_OPS (ann);
!   for (i = 0; i < NUM_USES (uses); i++)
!     check_loop_closed_ssa_use (bb, USE_OP (uses, i));
! 
!   vuses = VUSE_OPS (ann);
!   for (i = 0; i < NUM_VUSES (vuses); i++)
!     check_loop_closed_ssa_use (bb, VUSE_OP (vuses, i));
! 
!   v_may_defs = V_MAY_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
!     check_loop_closed_ssa_use (bb, V_MAY_DEF_OP (v_may_defs, i));
  }
  
  /* Checks that invariants of the loop closed ssa form are preserved.  */
--- 279,291 ----
  static void
  check_loop_closed_ssa_stmt (basic_block bb, tree stmt)
  {
!   ssa_op_iter iter;
!   tree var;
  
    get_stmt_operands (stmt);
  
!   FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_USES)
!     check_loop_closed_ssa_use (bb, var);
  }
  
  /* Checks that invariants of the loop closed ssa form are preserved.  */
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa.c,v
retrieving revision 2.28
diff -c -p -r2.28 tree-ssa.c
*** tree-ssa.c	18 Aug 2004 18:21:23 -0000	2.28
--- tree-ssa.c	24 Aug 2004 14:20:30 -0000
*************** verify_ssa (void)
*** 504,509 ****
--- 504,511 ----
    size_t i;
    basic_block bb;
    basic_block *definition_block = xcalloc (num_ssa_names, sizeof (basic_block));
+   ssa_op_iter iter;
+   tree op;
  
    timevar_push (TV_TREE_SSA_VERIFY);
  
*************** verify_ssa (void)
*** 528,570 ****
        for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
  	{
  	  tree stmt;
- 	  stmt_ann_t ann;
- 	  unsigned int j;
- 	  v_may_def_optype v_may_defs;
- 	  v_must_def_optype v_must_defs;
- 	  def_optype defs;
  
  	  stmt = bsi_stmt (bsi);
- 	  ann = stmt_ann (stmt);
  	  get_stmt_operands (stmt);
  
! 	  v_may_defs = V_MAY_DEF_OPS (ann);
! 	  if (ann->makes_aliased_stores && NUM_V_MAY_DEFS (v_may_defs) == 0)
  	    {
  	      error ("Statement makes aliased stores, but has no V_MAY_DEFS");
  	      debug_generic_stmt (stmt);
  	      goto err;
  	    }
  	    
! 	  for (j = 0; j < NUM_V_MAY_DEFS (v_may_defs); j++)
  	    {
- 	      tree op = V_MAY_DEF_RESULT (v_may_defs, j);
  	      if (verify_def (bb, definition_block, op, stmt, true))
  		goto err;
  	    }
            
! 	  v_must_defs = STMT_V_MUST_DEF_OPS (stmt);
! 	  for (j = 0; j < NUM_V_MUST_DEFS (v_must_defs); j++)
  	    {
- 	      tree op = V_MUST_DEF_OP (v_must_defs, j);
- 	      if (verify_def (bb, definition_block, op, stmt, true))
- 		goto err;
- 	    }
- 
- 	  defs = DEF_OPS (ann);
- 	  for (j = 0; j < NUM_DEFS (defs); j++)
- 	    {
- 	      tree op = DEF_OP (defs, j);
  	      if (verify_def (bb, definition_block, op, stmt, false))
  		goto err;
  	    }
--- 530,555 ----
        for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
  	{
  	  tree stmt;
  
  	  stmt = bsi_stmt (bsi);
  	  get_stmt_operands (stmt);
  
! 	  if (stmt_ann (stmt)->makes_aliased_stores 
! 	      && NUM_V_MAY_DEFS (STMT_V_MAY_DEF_OPS (stmt)) == 0)
  	    {
  	      error ("Statement makes aliased stores, but has no V_MAY_DEFS");
  	      debug_generic_stmt (stmt);
  	      goto err;
  	    }
  	    
! 	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_VIRTUAL_DEFS)
  	    {
  	      if (verify_def (bb, definition_block, op, stmt, true))
  		goto err;
  	    }
            
! 	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_DEF)
  	    {
  	      if (verify_def (bb, definition_block, op, stmt, false))
  		goto err;
  	    }
*************** verify_ssa (void)
*** 600,633 ****
        for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
  	{
  	  tree stmt = bsi_stmt (bsi);
- 	  stmt_ann_t ann = stmt_ann (stmt);
- 	  unsigned int j;
- 	  vuse_optype vuses;
- 	  v_may_def_optype v_may_defs;
- 	  use_optype uses;
- 
- 	  vuses = VUSE_OPS (ann); 
- 	  for (j = 0; j < NUM_VUSES (vuses); j++)
- 	    {
- 	      tree op = VUSE_OP (vuses, j);
- 	      if (verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
- 			      op, stmt, false, true))
- 		goto err;
- 	    }
  
! 	  v_may_defs = V_MAY_DEF_OPS (ann);
! 	  for (j = 0; j < NUM_V_MAY_DEFS (v_may_defs); j++)
  	    {
- 	      tree op = V_MAY_DEF_OP (v_may_defs, j);
  	      if (verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
  			      op, stmt, false, true))
  		goto err;
  	    }
  
! 	  uses = USE_OPS (ann);
! 	  for (j = 0; j < NUM_USES (uses); j++)
  	    {
- 	      tree op = USE_OP (uses, j);
  	      if (verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
  			      op, stmt, false, false))
  		goto err;
--- 585,600 ----
        for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
  	{
  	  tree stmt = bsi_stmt (bsi);
  
! 	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_VIRTUAL_USES)
  	    {
  	      if (verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
  			      op, stmt, false, true))
  		goto err;
  	    }
  
! 	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
  	    {
  	      if (verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
  			      op, stmt, false, false))
  		goto err;
*************** propagate_into_addr (tree stmt, tree var
*** 941,954 ****
  static void
  replace_immediate_uses (tree var, tree repl)
  {
-   use_optype uses;
-   vuse_optype vuses;
-   v_may_def_optype v_may_defs;
    int i, j, n;
    dataflow_t df;
    tree stmt;
    stmt_ann_t ann;
    bool mark_new_vars;
  
    df = get_immediate_uses (SSA_NAME_DEF_STMT (var));
    n = num_immediate_uses (df);
--- 908,920 ----
  static void
  replace_immediate_uses (tree var, tree repl)
  {
    int i, j, n;
    dataflow_t df;
    tree stmt;
    stmt_ann_t ann;
    bool mark_new_vars;
+   ssa_op_iter iter;
+   use_operand_p use_p;
  
    df = get_immediate_uses (SSA_NAME_DEF_STMT (var));
    n = num_immediate_uses (df);
*************** replace_immediate_uses (tree var, tree r
*** 982,1006 ****
  	      propagate_into_addr (stmt, var, &TREE_OPERAND (stmt, 1), repl);
  	    }
  
! 	  uses = USE_OPS (ann);
! 	  for (j = 0; j < (int) NUM_USES (uses); j++)
! 	    if (USE_OP (uses, j) == var)
  	      {
! 		propagate_value (USE_OP_PTR (uses, j), repl);
  		mark_new_vars = POINTER_TYPE_P (TREE_TYPE (repl));
  	      }
  	}
        else
  	{
! 	  vuses = VUSE_OPS (ann);
! 	  for (j = 0; j < (int) NUM_VUSES (vuses); j++)
! 	    if (VUSE_OP (vuses, j) == var)
! 	      propagate_value (VUSE_OP_PTR (vuses, j), repl);
! 
! 	  v_may_defs = V_MAY_DEF_OPS (ann);
! 	  for (j = 0; j < (int) NUM_V_MAY_DEFS (v_may_defs); j++)
! 	    if (V_MAY_DEF_OP (v_may_defs, j) == var)
! 	      propagate_value (V_MAY_DEF_OP_PTR (v_may_defs, j), repl);
  	}
  
        /* If REPL is a pointer, it may have different memory tags associated
--- 948,965 ----
  	      propagate_into_addr (stmt, var, &TREE_OPERAND (stmt, 1), repl);
  	    }
  
! 	  FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
! 	    if (USE_FROM_PTR (use_p) == var)
  	      {
! 		propagate_value (use_p, repl);
  		mark_new_vars = POINTER_TYPE_P (TREE_TYPE (repl));
  	      }
  	}
        else
  	{
! 	  FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_VIRTUAL_USES)
! 	    if (USE_FROM_PTR (use_p) == var)
! 	      propagate_value (use_p, repl);
  	}
  
        /* If REPL is a pointer, it may have different memory tags associated
Index: tree-ssanames.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssanames.c,v
retrieving revision 2.6
diff -c -p -r2.6 tree-ssanames.c
*** tree-ssanames.c	4 Aug 2004 20:37:38 -0000	2.6
--- tree-ssanames.c	24 Aug 2004 14:20:30 -0000
*************** duplicate_ssa_name (tree name, tree stmt
*** 295,319 ****
  void
  release_defs (tree stmt)
  {
!   size_t i;
!   v_may_def_optype v_may_defs;
!   v_must_def_optype v_must_defs;
!   def_optype defs;
!   stmt_ann_t ann;
  
!   ann = stmt_ann (stmt);
!   defs = DEF_OPS (ann);
!   v_may_defs = V_MAY_DEF_OPS (ann);
!   v_must_defs = V_MUST_DEF_OPS (ann);
! 
!   for (i = 0; i < NUM_DEFS (defs); i++)
!     release_ssa_name (DEF_OP (defs, i));
! 
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
!     release_ssa_name (V_MAY_DEF_RESULT (v_may_defs, i));
! 
!   for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
!     release_ssa_name (V_MUST_DEF_OP (v_must_defs, i));
  }
  
  
--- 295,305 ----
  void
  release_defs (tree stmt)
  {
!   tree def;
!   ssa_op_iter iter;
  
!   FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS)
!     release_ssa_name (def);
  }
  
  
Index: tree-vectorizer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-vectorizer.c,v
retrieving revision 2.2
diff -c -p -r2.2 tree-vectorizer.c
*** tree-vectorizer.c	19 Aug 2004 07:16:55 -0000	2.2
--- tree-vectorizer.c	24 Aug 2004 14:20:31 -0000
*************** vect_create_data_ref (tree stmt, block_s
*** 735,745 ****
    tree vect_ptr_type;
    tree vect_ptr;
    tree addr_ref;
-   v_may_def_optype v_may_defs = STMT_V_MAY_DEF_OPS (stmt);
-   v_must_def_optype v_must_defs = STMT_V_MUST_DEF_OPS (stmt);
-   vuse_optype vuses = STMT_VUSE_OPS (stmt);
-   int nvuses, nv_may_defs, nv_must_defs;
-   int i;
    struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
    tree array_type;
    tree base_addr = NULL_TREE;
--- 735,740 ----
*************** vect_create_data_ref (tree stmt, block_s
*** 748,753 ****
--- 743,750 ----
    tree tag;
    tree addr_expr;
    tree scalar_ptr_type;
+   tree use;
+   ssa_op_iter iter;
  
    /* FORNOW: make sure the data reference is aligned.  */
    vect_align_data_ref (stmt);
*************** vect_create_data_ref (tree stmt, block_s
*** 804,830 ****
    
    /* Mark for renaming all aliased variables
       (i.e, the may-aliases of the type-mem-tag) */
!   nvuses = NUM_VUSES (vuses);
!   nv_may_defs = NUM_V_MAY_DEFS (v_may_defs);
!   nv_must_defs = NUM_V_MUST_DEFS (v_must_defs);
!   for (i = 0; i < nvuses; i++)
      {
-       tree use = VUSE_OP (vuses, i);
        if (TREE_CODE (use) == SSA_NAME)
          bitmap_set_bit (vars_to_rename, var_ann (SSA_NAME_VAR (use))->uid);
      }
-   for (i = 0; i < nv_may_defs; i++)
-     {
-       tree def = V_MAY_DEF_RESULT (v_may_defs, i);
-       if (TREE_CODE (def) == SSA_NAME)
-         bitmap_set_bit (vars_to_rename, var_ann (SSA_NAME_VAR (def))->uid);
-     }
-   for (i = 0; i < nv_must_defs; i++)
-     {
-       tree def = V_MUST_DEF_OP (v_must_defs, i);
-       if (TREE_CODE (def) == SSA_NAME)
-         bitmap_set_bit (vars_to_rename, var_ann (SSA_NAME_VAR (def))->uid);
-     }
  
    pe = loop_preheader_edge (loop);
  
--- 801,812 ----
    
    /* Mark for renaming all aliased variables
       (i.e, the may-aliases of the type-mem-tag) */
!   FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter,
! 			     (SSA_OP_VIRTUAL_DEFS | SSA_OP_VUSE))
      {
        if (TREE_CODE (use) == SSA_NAME)
          bitmap_set_bit (vars_to_rename, var_ann (SSA_NAME_VAR (use))->uid);
      }
  
    pe = loop_preheader_edge (loop);
  


More information about the Gcc-patches mailing list