[patch] Statement operand iterators

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Fri Jun 25 05:42:00 GMT 2004


Hello,

here is the reimplementation of the idea.  The thing now uses macros in
such a way that gcc is able to determine in compile time which type of
operands is accessed.  The macros make it a small bit harder to use --
the example I used in the first mail would now be written as

oii oi;
FOR_STMT_OPERANDS (&oii, stmt, OI_ALL_USES,
  {
    code;
  });

with the negative effects of this type of macros (hard to
debug, impossible to use #ifs in code); but at least (unlike
EXECUTE_IF_SET_IN_BITMAP macro) `break' in code will work as expected.

On the other hand, it no longer causes any measurable slowdowns.

Bootstrapped & regtested on i686.

Zdenek

Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-dfa.c,v
retrieving revision 2.13
diff -c -3 -p -r2.13 tree-dfa.c
*** tree-dfa.c	23 Jun 2004 20:12:42 -0000	2.13
--- tree-dfa.c	24 Jun 2004 21:40:45 -0000
*************** compute_immediate_uses_for_phi (tree phi
*** 274,284 ****
  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.  */
--- 274,281 ----
  static void
  compute_immediate_uses_for_stmt (tree stmt, int flags, bool (*calc_for)(tree))
  {
!   oii oi;
!   unsigned types = 0;
  
  #ifdef ENABLE_CHECKING
    /* PHI nodes are handled elsewhere.  */
*************** compute_immediate_uses_for_stmt (tree st
*** 287,325 ****
  #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);
! 	}
!     }
  
    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);
! 	}
!     }
  }
  
  
--- 284,302 ----
  #endif
  
    /* Look at USE_OPS or VUSE_OPS according to FLAGS.  */
    if (flags & TDFA_USE_OPS)
!     types |= OI_USES;
  
    if (flags & TDFA_USE_VOPS)
!     types |= OI_VUSES;
  
!   FOR_STMT_OPERANDS (&oi, stmt, types,
!     {
!       tree use = oi_op (&oi);
!       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);
!     });
  }
  
  
*************** redirect_immediate_use (tree use, tree o
*** 384,404 ****
  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);
  }
  
  
--- 361,370 ----
  void
  redirect_immediate_uses (tree old, tree new)
  {
!   oii oi;
  
!   FOR_STMT_OPERANDS (&oi, old, OI_ALL_USES,
!     redirect_immediate_use (oi_op (&oi), old, new));
  }
  
  
Index: tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-flow-inline.h,v
retrieving revision 2.11
diff -c -3 -p -r2.11 tree-flow-inline.h
*** tree-flow-inline.h	18 Jun 2004 14:05:19 -0000	2.11
--- tree-flow-inline.h	24 Jun 2004 21:40:45 -0000
*************** get_tree_ann (tree t)
*** 765,768 ****
--- 765,977 ----
    return (ann) ? ann : create_tree_ann (t);
  }
  
+ /* Inline definitions of the operand iterator functions.  */
+ 
+ /* Initializes the operand iterator OI on statement annotations ANN for
+    operands of type TYPE.  */
+ 
+ static inline void
+ oi_init (struct op_iterator *oi, struct stmt_ann_d *ann, enum oi_op_type type)
+ {
+   oi->type = type;
+   oi->aop = 0;
+ 
+   switch (type)
+     {
+     case OT_DEF:
+       oi->aops.defs = DEF_OPS (ann);
+       oi->aop_max = NUM_DEFS (oi->aops.defs);
+       break;
+ 
+     case OT_USE:
+       oi->aops.uses = USE_OPS (ann);
+       oi->aop_max = NUM_USES (oi->aops.uses);
+       break;
+ 
+     case OT_VDEF_DEF:
+     case OT_VDEF_USE:
+       oi->aops.v_may_defs = V_MAY_DEF_OPS (ann);
+       oi->aop_max = NUM_V_MAY_DEFS (oi->aops.v_may_defs);
+       break;
+ 
+     case OT_VMUST_DEF:
+       oi->aops.v_must_defs = V_MUST_DEF_OPS (ann);
+       oi->aop_max = NUM_V_MUST_DEFS (oi->aops.v_must_defs);
+       break;
+ 
+     case OT_VUSE:
+       oi->aops.vuses = VUSE_OPS (ann);
+       oi->aop_max = NUM_VUSES (oi->aops.vuses);
+       break;
+ 	
+     default:
+       abort ();
+     }
+ }
+ 
+ /* Checks whether we have already processed all operands through iterator
+    OI.  */
+ 
+ static inline bool
+ oi_end_p (const struct op_iterator *oi)
+ {
+   return oi->aop >= oi->aop_max;
+ }
+ 
+ /* Moves operand iterator OI to the next operand.  */
+ 
+ static inline void
+ oi_next (struct op_iterator *oi)
+ {
+   oi->aop++;
+ }
+ 
+ /* Gets the operand pointed to by OI.  */
+ 
+ static inline tree
+ oi_op (const struct op_iterator *oi)
+ {
+   switch (oi->type)
+     {
+     case OT_DEF:
+       return DEF_OP (oi->aops.defs, oi->aop);
+ 
+     case OT_USE:
+       return USE_OP (oi->aops.uses, oi->aop);
+ 
+     case OT_VDEF_DEF:
+       return V_MAY_DEF_RESULT (oi->aops.v_may_defs, oi->aop);
+ 
+     case OT_VDEF_USE:
+       return V_MAY_DEF_OP (oi->aops.v_may_defs, oi->aop);
+ 
+     case OT_VMUST_DEF:
+       return V_MUST_DEF_OP (oi->aops.v_must_defs, oi->aop);
+ 
+     case OT_VUSE:
+       return VUSE_OP (oi->aops.vuses, oi->aop);
+ 
+     default:
+       abort ();
+     }
+ }
+ 
+ /* Sets the operand pointed to by OI to VAL.  */
+ 
+ static inline void
+ oi_set_op (struct op_iterator *oi, tree val)
+ {
+   switch (oi->type)
+     {
+     case OT_DEF:
+       SET_DEF_OP (oi->aops.defs, oi->aop, val);
+       break;
+ 
+     case OT_USE:
+       SET_USE_OP (oi->aops.uses, oi->aop, val);
+       break;
+ 
+     case OT_VDEF_DEF:
+       SET_V_MAY_DEF_RESULT (oi->aops.v_may_defs, oi->aop, val);
+       break;
+ 
+     case OT_VDEF_USE:
+       SET_V_MAY_DEF_OP (oi->aops.v_may_defs, oi->aop, val);
+       break;
+ 
+     case OT_VMUST_DEF:
+       SET_V_MUST_DEF_OP (oi->aops.v_must_defs, oi->aop, val);
+       break;
+ 
+     case OT_VUSE:
+       SET_VUSE_OP (oi->aops.vuses, oi->aop, val);
+       break;
+ 
+     default:
+       abort ();
+     }
+ }
+ 
+ /* Returns true if operand pointed to by OI is a definition.  */
+ 
+ static inline bool
+ oi_def_p (const struct op_iterator *oi)
+ {
+   return ((1 << oi->type) & OI_ALL_DEFS) != 0;
+ }
+ 
+ /* Returns true if operand pointed to by OI is virtual.  */
+ 
+ static inline bool
+ oi_virtual_p (const struct op_iterator *oi)
+ {
+   return ((1 << oi->type) & OI_ALL_VIRTUAL) != 0;
+ }
+ 
+ /* Gets the use_ptr to operand pointed to by OI.  */
+ 
+ static inline use_operand_p
+ oi_use_ptr (const struct op_iterator *oi)
+ {
+   switch (oi->type)
+     {
+     case OT_USE:
+       return USE_OP_PTR (oi->aops.uses, oi->aop);
+ 
+     case OT_VDEF_USE:
+       return V_MAY_DEF_OP_PTR (oi->aops.v_may_defs, oi->aop);
+ 
+     case OT_VUSE:
+       return VUSE_OP_PTR (oi->aops.vuses, oi->aop);
+ 
+     default:
+       abort ();
+     }
+ }
+ 
+ /* Gets the def_ptr to operand pointed to by OI.  */
+ 
+ static inline def_operand_p
+ oi_def_ptr (const struct op_iterator *oi)
+ {
+   switch (oi->type)
+     {
+     case OT_DEF:
+       return DEF_OP_PTR (oi->aops.defs, oi->aop);
+ 
+     case OT_VDEF_DEF:
+       return V_MAY_DEF_RESULT_PTR (oi->aops.v_may_defs, oi->aop);
+ 
+     case OT_VMUST_DEF:
+       return V_MUST_DEF_OP_PTR (oi->aops.v_must_defs, oi->aop);
+ 
+     default:
+       abort ();
+     }
+ }
+ 
+ /* For operand iterator OI pointing to V_MAY_DEF_RESULT,
+    return use_ptr of corresponding V_MAY_DEF_OP.  */
+ 
+ static inline use_operand_p
+ oi_use_ptr_from_vdef_def (const struct op_iterator *oi)
+ {
+   if (oi->type != OT_VDEF_DEF)
+     abort ();
+ 
+   return V_MAY_DEF_OP_PTR (oi->aops.v_may_defs, oi->aop);
+ }
+ 
+ /* For operand iterator OI pointing to V_MAY_DEF_OP,
+    return def_ptr of corresponding V_MAY_DEF_RESULT.  */
+ 
+ static inline def_operand_p
+ oi_def_ptr_from_vdef_use (const struct op_iterator *oi)
+ {
+   if (oi->type != OT_VDEF_USE)
+     abort ();
+ 
+   return V_MAY_DEF_RESULT_PTR (oi->aops.v_may_defs, oi->aop);
+ }
+ 
  #endif /* _TREE_FLOW_INLINE_H  */
Index: tree-into-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-into-ssa.c,v
retrieving revision 2.11
diff -c -3 -p -r2.11 tree-into-ssa.c
*** tree-into-ssa.c	17 Jun 2004 18:13:15 -0000	2.11
--- tree-into-ssa.c	24 Jun 2004 21:40:45 -0000
*************** mark_def_sites (struct dom_walk_data *wa
*** 212,301 ****
  {
    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))
! 	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);
  	}
!     }
! 
!   /* 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);
! 	  SET_BIT (kills, uid);
! 	}
!     }
  
    /* 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);
  	  SET_BIT (kills, uid);
  	}
!     }
  }
  
  
--- 212,267 ----
  {
    struct mark_def_sites_global_data *gd = walk_data->global_data;
    sbitmap kills = gd->kills;
!   oii oi;
!   size_t uid;
    tree stmt;
  
    /* 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_STMT_OPERANDS (&oi, stmt, OI_USES_AND_VUSES,
      {
!       use_operand_p use_p = oi_use_ptr (&oi);
  
        if (prepare_use_operand_for_rename (use_p, &uid)
  	  && !TEST_BIT (kills, uid))
  	set_livein_block (USE_FROM_PTR (use_p), bb);
!     });
  
!   /* Process the virtual may-defs made by this statement.  These do not set
!      or test KILL. */
!   FOR_STMT_OPERANDS (&oi, stmt, OI_V_MAY_DEFS,
      {
!       use_operand_p use_p = oi_use_ptr_from_vdef_def (&oi);
! 
        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 (oi_op (&oi)) != SSA_NAME)
! 	    oi_set_op (&oi, USE_FROM_PTR (use_p));
  	    
            set_livein_block (USE_FROM_PTR (use_p), bb);
! 	  set_def_block (oi_op (&oi), bb);
  	}
!     });
  
    /* Now process the definition made by this statement.  Mark the
       variables in KILLS.  */
!   FOR_STMT_OPERANDS (&oi, stmt, OI_ALL_DEFS,
      {
!       tree def = oi_op (&oi);
  
        if (prepare_def_operand_for_rename (def, &uid))
  	{
  	  set_def_block (def, bb);
  	  SET_BIT (kills, uid);
  	}
!     });
  }
  
  
*************** rewrite_stmt (struct dom_walk_data *walk
*** 740,759 ****
  	      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);
  
    stmt = bsi_stmt (si);
-   ann = stmt_ann (stmt);
  
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
--- 706,718 ----
  	      basic_block bb ATTRIBUTE_UNUSED,
  	      block_stmt_iterator si)
  {
    tree stmt;
    struct rewrite_block_data *bd;
+   oii oi;
  
    bd = VARRAY_TOP_GENERIC_PTR (walk_data->block_data_stack);
  
    stmt = bsi_stmt (si);
  
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
*************** rewrite_stmt (struct dom_walk_data *walk
*** 765,792 ****
  #if defined ENABLE_CHECKING
    /* We have just scanned the code for operands.  No statement should
       be modified.  */
!   if (ann->modified)
      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));
--- 724,740 ----
  #if defined ENABLE_CHECKING
    /* We have just scanned the code for operands.  No statement should
       be modified.  */
!   if (stmt_modified_p (stmt))
      abort ();
  #endif
  
    /* Step 1.  Rewrite USES and VUSES in the statement.  */
!   FOR_STMT_OPERANDS (&oi, stmt, OI_ALL_USES,
!     rewrite_operand (oi_use_ptr (&oi)));
  
!   FOR_STMT_OPERANDS (&oi, stmt, OI_ALL_DEFS,
      {
!       def_operand_p def_p = oi_def_ptr (&oi);
  
        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
*** 794,830 ****
        /* FIXME: We shouldn't be registering new defs if the variable
  	 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);
!     }
!     
  }
  
  
--- 742,748 ----
        /* FIXME: We shouldn't be registering new defs if the variable
  	 doesn't need to be renamed.  */
        register_new_def (DEF_FROM_PTR (def_p), &bd->block_defs);
!     });
  }
  
  
Index: tree-sra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-sra.c,v
retrieving revision 2.8
diff -c -3 -p -r2.8 tree-sra.c
*** tree-sra.c	22 Jun 2004 03:06:41 -0000	2.8
--- tree-sra.c	24 Jun 2004 21:40:45 -0000
*************** sra_elt_eq (const void *x, const void *y
*** 111,154 ****
    return true;
  }
  
! /* Mark all the variables in V_MAY_DEF operands for STMT for renaming.
     This becomes necessary when we modify all of a non-scalar.  */
  
  static void
! mark_all_v_may_defs (tree stmt)
  {
!   v_may_def_optype v_may_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);
        bitmap_set_bit (vars_to_rename, var_ann (sym)->uid);
!     }
! }
! 
! /* Mark all the variables in V_MUST_DEF operands for STMT for renaming.
!    This becomes necessary when we modify all of a non-scalar.  */
! 
! static void
! mark_all_v_must_defs (tree stmt)
! {
!   v_must_def_optype v_must_defs;
!   size_t i, n;
! 
!   get_stmt_operands (stmt);
!   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);
!       bitmap_set_bit (vars_to_rename, var_ann (sym)->uid);
!     }
  }
  
  /* Return true if DECL is an SRA candidate.  */
--- 111,131 ----
    return true;
  }
  
! /* Mark all the variables in VDEF operands for STMT for renaming.
     This becomes necessary when we modify all of a non-scalar.  */
  
  static void
! mark_all_vdefs (tree stmt)
  {
!   oii oi;
  
    get_stmt_operands (stmt);
  
!   FOR_STMT_OPERANDS (&oi, stmt, OI_VDEFS,
      {
!       tree sym = oi_op (&oi);
        bitmap_set_bit (vars_to_rename, var_ann (sym)->uid);
!     });
  }
  
  /* Return true if DECL is an SRA candidate.  */
*************** create_scalar_copies (tree lhs, tree rhs
*** 704,711 ****
  
        /* Mark all the variables in VDEF operands for renaming, because
  	 the VA_ARG_EXPR will now be in a different statement.  */
!       mark_all_v_may_defs (stmt);
!       mark_all_v_must_defs (stmt);
  
        /* Set RHS to be the new temporary TMP.  */
        rhs = tmp;
--- 681,687 ----
  
        /* Mark all the variables in VDEF operands for renaming, because
  	 the VA_ARG_EXPR will now be in a different statement.  */
!       mark_all_vdefs (stmt);
  
        /* Set RHS to be the new temporary TMP.  */
        rhs = tmp;
*************** create_scalar_copies (tree lhs, tree rhs
*** 804,811 ****
  	  /* Otherwise, mark all the symbols in the VDEFs for the last
  	     scalarized statement just created.  Since all the statements
  	     introduce the same VDEFs, we only need to check the last one.  */
! 	  mark_all_v_may_defs (tsi_stmt (tsi));
! 	  mark_all_v_must_defs (tsi_stmt (tsi));
  	}
        else
  	abort ();
--- 780,786 ----
  	  /* Otherwise, mark all the symbols in the VDEFs for the last
  	     scalarized statement just created.  Since all the statements
  	     introduce the same VDEFs, we only need to check the last one.  */
! 	  mark_all_vdefs (tsi_stmt (tsi));
  	}
        else
  	abort ();
Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.8
diff -c -3 -p -r2.8 tree-ssa-alias.c
*** tree-ssa-alias.c	16 Jun 2004 23:03:31 -0000	2.8
--- tree-ssa-alias.c	24 Jun 2004 21:40:45 -0000
*************** compute_points_to_and_addr_escape (struc
*** 524,529 ****
--- 524,530 ----
  {
    basic_block bb;
    size_t i;
+   oii oi;
  
    timevar_push (TV_TREE_PTA);
  
*************** compute_points_to_and_addr_escape (struc
*** 534,544 ****
  
        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);
--- 535,540 ----
*************** compute_points_to_and_addr_escape (struc
*** 577,587 ****
  		  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;
--- 573,581 ----
  		  mark_call_clobbered (var);
  		});
  
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_USES,
  	    {
! 	      tree op = oi_op (&oi);
  	      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
*** 643,684 ****
  		  if (get_call_expr_in (stmt))
  		    bitmap_set_bit (ai->dereferenced_ptrs_store, v_ann->uid);
  		}
! 	    }
  
  	  /* 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);
  	      if (may_be_aliased (var))
  		(VARRAY_UINT (ai->num_references, ann->uid))++;
! 	    }
  
  	  /* 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
--- 637,667 ----
  		  if (get_call_expr_in (stmt))
  		    bitmap_set_bit (ai->dereferenced_ptrs_store, v_ann->uid);
  		}
! 	    });
  
  	  /* Update reference counter for definitions to any
  	     potentially aliased variable.  This is used in the alias
  	     grouping heuristics.  */
! 
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_DEFS,
  	    {
! 	      tree op = oi_op (&oi);
  	      tree var = SSA_NAME_VAR (op);
  	      var_ann_t ann = var_ann (var);
  	      bitmap_set_bit (ai->written_vars, ann->uid);
  	      if (may_be_aliased (var))
  		(VARRAY_UINT (ai->num_references, ann->uid))++;
! 	    });
  
  	  /* Mark variables in V_MAY_DEF operands as being written to.  */
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_VDEFS,
  	    {
! 	      tree op = oi_op (&oi);
  	      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)
*** 2103,2114 ****
  
  	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));
  	  }
      }
  
--- 2086,2096 ----
  
  	for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
  	  {
! 	    oii oi;
! 
! 	    FOR_STMT_OPERANDS (&oi, bsi_stmt (si), OI_DEFS,
! 	      if (POINTER_TYPE_P (TREE_TYPE (oi_op (&oi))))
! 		dump_points_to_info_for (file, oi_op (&oi)));
  	  }
      }
  
Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-ccp.c,v
retrieving revision 2.13
diff -c -3 -p -r2.13 tree-ssa-ccp.c
*** tree-ssa-ccp.c	23 Jun 2004 00:25:55 -0000	2.13
--- tree-ssa-ccp.c	24 Jun 2004 21:40:45 -0000
*************** cp_lattice_meet (value val1, value val2)
*** 608,618 ****
  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.  */
--- 608,615 ----
  static void
  visit_stmt (tree stmt)
  {
    stmt_ann_t ann;
!   oii oi;
  
    /* If the statement has already been deemed to be VARYING, don't simulate
       it again.  */
*************** visit_stmt (tree stmt)
*** 644,657 ****
  
    /* 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);
! 	}
      }
  
    /* If STMT is a conditional branch, see if we can determine which branch
--- 641,651 ----
  
    /* 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_STMT_OPERANDS (&oi, stmt, OI_DEFS,
! 	def_to_varying (oi_op (&oi)));
      }
  
    /* If STMT is a conditional branch, see if we can determine which branch
*************** visit_stmt (tree stmt)
*** 671,685 ****
  	add_outgoing_control_edges (bb_for_stmt (stmt));
      }
  
!   /* 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));
!     
!   /* Mark all V_MUST_DEF operands VARYING.  */
!   v_must_defs = V_MUST_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
!     def_to_varying (V_MUST_DEF_OP (v_must_defs, i));
  }
  
  
--- 665,673 ----
  	add_outgoing_control_edges (bb_for_stmt (stmt));
      }
  
!   /* Mark all VDEF operands VARYING.  */
!   FOR_STMT_OPERANDS (&oi, stmt, OI_VDEFS,
!     def_to_varying (oi_op (&oi)));
  }
  
  
*************** ccp_fold (tree stmt)
*** 932,955 ****
  	       == FUNCTION_DECL)
  	   && DECL_BUILT_IN (TREE_OPERAND (TREE_OPERAND (rhs, 0), 0)))
      {
!       use_optype uses = STMT_USE_OPS (stmt);
!       if (NUM_USES (uses) != 0)
  	{
  	  tree *orig;
! 	  size_t i;
  
  	  /* Preserve the original values of every operand.  */
! 	  orig = xmalloc (sizeof (tree) * NUM_USES (uses));
! 	  for (i = 0; i < NUM_USES (uses); i++)
! 	    orig[i] = USE_OP (uses, i);
  
  	  /* Substitute operands with their values and try to fold.  */
  	  replace_uses_in (stmt, NULL);
  	  retval = fold_builtin (rhs);
  
  	  /* Restore operands to their original form.  */
! 	  for (i = 0; i < NUM_USES (uses); i++)
! 	    SET_USE_OP (uses, i, orig[i]);
  	  free (orig);
  	}
      }
--- 920,946 ----
  	       == FUNCTION_DECL)
  	   && DECL_BUILT_IN (TREE_OPERAND (TREE_OPERAND (rhs, 0), 0)))
      {
!       unsigned num = NUM_USES (STMT_USE_OPS (stmt));
! 
!       if (num > 0)
  	{
  	  tree *orig;
! 	  oii oi;
! 	  unsigned index = 0;
  
  	  /* Preserve the original values of every operand.  */
! 	  orig = xmalloc (sizeof (tree) * num);
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_USES,
! 	    orig[index++] = oi_op (&oi));
  
  	  /* Substitute operands with their values and try to fold.  */
  	  replace_uses_in (stmt, NULL);
  	  retval = fold_builtin (rhs);
  
  	  /* Restore operands to their original form.  */
! 	  index = 0;
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_USES,
! 	    oi_set_op (&oi, orig[index++]));
  	  free (orig);
  	}
      }
*************** initialize (void)
*** 1137,1148 ****
      {
        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.  */
        for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
--- 1128,1135 ----
      {
        block_stmt_iterator i;
        tree stmt;
        int vary;
+       oii oi;
  
        /* Get the default value for each definition.  */
        for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
*************** initialize (void)
*** 1150,1182 ****
  	  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;
! 	    }
  	  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));
! 	    }
! 	    
! 	  /* Mark all V_MUST_DEF operands VARYING.  */
! 	  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);
! 	      get_value (v_must_def)->lattice_val = VARYING;
! 	      SET_BIT (virtual_var, SSA_NAME_VERSION (v_must_def));
! 	    }
  	}
  
        for (e = bb->succ; e; e = e->succ_next)
--- 1137,1158 ----
  	  vary = 0;
  	  stmt = bsi_stmt (i);
  	  get_stmt_operands (stmt);
! 
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_DEFS,
  	    {
! 	      tree def = oi_op (&oi);
  	      if (get_value (def)->lattice_val == VARYING)
  		vary = 1;
! 	    });
  	  DONT_SIMULATE_AGAIN (stmt) = vary;
  
! 	  /* Mark all VDEF operands VARYING.  */
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_VDEFS,
  	    {
! 	      tree res = oi_op (&oi);
  	      get_value (res)->lattice_val = VARYING;
  	      SET_BIT (virtual_var, SSA_NAME_VERSION (res));
! 	    });
  	}
  
        for (e = bb->succ; e; e = e->succ_next)
*************** static bool
*** 1415,1443 ****
  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)
  	{
! 	  SET_USE (use, val->const_val);
  	  replaced = true;
! 	  if (POINTER_TYPE_P (TREE_TYPE (USE_FROM_PTR (use))) 
  	      && replaced_addresses_p)
  	    *replaced_addresses_p = true;
  	}
!     }
  
    return replaced;
  }
--- 1391,1417 ----
  replace_uses_in (tree stmt, bool *replaced_addresses_p)
  {
    bool replaced = false;
!   oii oi;
  
    if (replaced_addresses_p)
      *replaced_addresses_p = false;
  
    get_stmt_operands (stmt);
  
!   FOR_STMT_OPERANDS (&oi, stmt, OI_USES,
      {
!       tree use = oi_op (&oi);
!       value *val = get_value (use);
  
        if (val->lattice_val == CONSTANT)
  	{
! 	  oi_set_op (&oi, val->const_val);
  	  replaced = true;
! 	  if (POINTER_TYPE_P (TREE_TYPE (use)) 
  	      && replaced_addresses_p)
  	    *replaced_addresses_p = true;
  	}
!     });
  
    return replaced;
  }
*************** replace_uses_in (tree stmt, bool *replac
*** 1455,1464 ****
  static latticevalue
  likely_value (tree stmt)
  {
-   use_optype uses;
-   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.  */
--- 1429,1438 ----
  static latticevalue
  likely_value (tree stmt)
  {
    int found_constant = 0;
    stmt_ann_t ann;
+   oii oi;
+   bool no_uses = true;
  
    /* If the statement makes aliased loads or has volatile operands, it
       won't fold to a constant value.  */
*************** likely_value (tree stmt)
*** 1473,1492 ****
  
    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)
  	return UNDEFINED;
  
        if (val->lattice_val == CONSTANT)
  	found_constant = 1;
!     }
  
!   return ((found_constant || !uses) ? CONSTANT : VARYING);
  }
  
  /* A subroutine of fold_stmt_r.  Attempts to fold *(A+O) to A[X].
--- 1447,1467 ----
  
    get_stmt_operands (stmt);
  
!   FOR_STMT_OPERANDS (&oi, stmt, OI_USES,
      {
!       tree use = oi_op (&oi);
        value *val = get_value (use);
  
+       no_uses = false;
+ 
        if (val->lattice_val == UNDEFINED)
  	return UNDEFINED;
  
        if (val->lattice_val == CONSTANT)
  	found_constant = 1;
!     });
  
!   return ((found_constant || no_uses) ? CONSTANT : VARYING);
  }
  
  /* A subroutine of fold_stmt_r.  Attempts to fold *(A+O) to A[X].
*************** set_rhs (tree *stmt_p, tree expr)
*** 2160,2195 ****
  
        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;
! 	    }
  	}
      }
  }
--- 2135,2151 ----
  
        if (TREE_SIDE_EFFECTS (expr))
  	{
! 	  oii oi;
  
  	  /* Fix all the SSA_NAMEs created by *STMT_P to point to its new
  	     replacement.  */
  
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_ALL_DEFS,
  	    {
! 	      tree var = oi_op (&oi);
  	      if (TREE_CODE (var) == SSA_NAME)
  		SSA_NAME_DEF_STMT (var) = *stmt_p;
! 	    });
  	}
      }
  }
Index: tree-ssa-copy.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-copy.c,v
retrieving revision 2.7
diff -c -3 -p -r2.7 tree-ssa-copy.c
*** tree-ssa-copy.c	17 Jun 2004 18:13:17 -0000	2.7
--- tree-ssa-copy.c	24 Jun 2004 21:40:45 -0000
*************** bool
*** 254,294 ****
  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 (ann, 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 (ann, 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 (ann, op_p, const_and_copies);
-     }
    return may_have_exposed_new_symbols;
  }
  
--- 254,270 ----
  cprop_into_stmt (tree stmt, varray_type const_and_copies)
  {
    bool may_have_exposed_new_symbols = false;
+   oii oi;
    stmt_ann_t ann = stmt_ann (stmt);
  
!   FOR_STMT_OPERANDS (&oi, stmt, OI_ALL_USES,
      {
!       use_operand_p op_p = oi_use_ptr (&oi);
        if (TREE_CODE (USE_FROM_PTR (op_p)) == SSA_NAME)
  	may_have_exposed_new_symbols
  	  |= cprop_operand (ann, op_p, const_and_copies);
!     });
  
    return may_have_exposed_new_symbols;
  }
  
Index: tree-ssa-dce.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dce.c,v
retrieving revision 2.7
diff -c -3 -p -r2.7 tree-ssa-dce.c
*** tree-ssa-dce.c	16 Jun 2004 23:03:32 -0000	2.7
--- tree-ssa-dce.c	24 Jun 2004 21:40:45 -0000
*************** need_to_preserve_store (tree ssa_name)
*** 285,295 ****
  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;
  
    /* Statements that are implicitly live.  Most function calls, asm and return
       statements are required.  Labels and BIND_EXPR nodes are kept because
--- 285,292 ----
  static void
  mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
  {
!   oii oi;
    stmt_ann_t ann;
  
    /* 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
*** 377,414 ****
  
    get_stmt_operands (stmt);
  
!   defs = DEF_OPS (ann);
!   for (i = 0; i < NUM_DEFS (defs); i++)
      {
!       tree def = DEF_OP (defs, i);
        if (need_to_preserve_store (def))
  	{
  	  mark_stmt_necessary (stmt, true);
  	  return;
          }
!     }
! 
!   v_may_defs = V_MAY_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
!     {
!       tree v_may_def = V_MAY_DEF_RESULT (v_may_defs, i);
!       if (need_to_preserve_store (v_may_def))
! 	{
! 	  mark_stmt_necessary (stmt, true);
! 	  return;
!         }
!     }
!     
!   v_must_defs = V_MUST_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++)
!     {
!       tree v_must_def = V_MUST_DEF_OP (v_must_defs, i);
!       if (need_to_preserve_store (v_must_def))
! 	{
! 	  mark_stmt_necessary (stmt, true);
! 	  return;
!         }
!     }
  
    return;
  }
--- 374,388 ----
  
    get_stmt_operands (stmt);
  
!   FOR_STMT_OPERANDS (&oi, stmt, OI_ALL_DEFS,
      {
!       tree def = oi_op (&oi);
        if (need_to_preserve_store (def))
  	{
  	  mark_stmt_necessary (stmt, true);
  	  return;
          }
!     });
  
    return;
  }
*************** propagate_necessity (struct edge_list *e
*** 580,609 ****
  	  /* 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));
  	}
      }
  }
--- 554,564 ----
  	  /* 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.  */
! 	  oii oi;
  	  get_stmt_operands (i);
  
! 	  FOR_STMT_OPERANDS (&oi, i, OI_ALL_USES,
! 	    mark_operand_necessary (oi_op (&oi)));
  	}
      }
  }
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
retrieving revision 2.14
diff -c -3 -p -r2.14 tree-ssa-dom.c
*** tree-ssa-dom.c	24 Jun 2004 15:59:48 -0000	2.14
--- tree-ssa-dom.c	24 Jun 2004 21:40:46 -0000
*************** redirect_edges_and_update_ssa_graph (var
*** 346,383 ****
  	 are bypassing must also be taken our of SSA form.  */
        for (bsi = bsi_start (e->dest); ! bsi_end_p (bsi); bsi_next (&bsi))
  	{
- 	  unsigned int j;
- 	  def_optype defs;
- 	  v_may_def_optype v_may_defs;
- 	  v_must_def_optype v_must_defs;
  	  tree stmt = bsi_stmt (bsi);
! 	  stmt_ann_t ann = stmt_ann (stmt);
  
  	  if (TREE_CODE (stmt) == COND_EXPR)
  	    break;
  
  	  get_stmt_operands (stmt);
  
! 	  defs = DEF_OPS (ann);
! 	  for (j = 0; j < NUM_DEFS (defs); j++)
  	    {
! 	      tree op = SSA_NAME_VAR (DEF_OP (defs, j));
  	      bitmap_set_bit (vars_to_rename, var_ann (op)->uid);
! 	    }
! 
! 	  v_may_defs = STMT_V_MAY_DEF_OPS (stmt);
! 	  for (j = 0; j < NUM_V_MAY_DEFS (v_may_defs); j++)
! 	    {
! 	      tree op = V_MAY_DEF_RESULT (v_may_defs, j);
! 	      bitmap_set_bit (vars_to_rename, var_ann (op)->uid);
! 	    }
! 	    
! 	  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);
! 	      bitmap_set_bit (vars_to_rename, var_ann (op)->uid);
! 	    }
  	}
  
        /* Finally, any variables in PHI nodes at our final destination
--- 346,366 ----
  	 are bypassing must also be taken our of SSA form.  */
        for (bsi = bsi_start (e->dest); ! bsi_end_p (bsi); bsi_next (&bsi))
  	{
  	  tree stmt = bsi_stmt (bsi);
! 	  oii oi;
  
  	  if (TREE_CODE (stmt) == COND_EXPR)
  	    break;
  
  	  get_stmt_operands (stmt);
  
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_ALL_DEFS,
  	    {
! 	      tree op = oi_op (&oi);
! 	      if (TREE_CODE (op) == SSA_NAME)
! 		op = SSA_NAME_VAR (op);
  	      bitmap_set_bit (vars_to_rename, var_ann (op)->uid);
! 	    });
  	}
  
        /* Finally, any variables in PHI nodes at our final destination
*************** thread_across_edge (struct dom_walk_data
*** 745,794 ****
        if (!cached_lhs)
  	{
  	  /* Copy the operands.  */
! 	  stmt_ann_t ann = stmt_ann (stmt);
! 	  use_optype uses = USE_OPS (ann);
! 	  vuse_optype vuses = VUSE_OPS (ann);
! 	  tree *uses_copy = xcalloc (NUM_USES (uses),  sizeof (tree));
! 	  tree *vuses_copy = xcalloc (NUM_VUSES (vuses), sizeof (tree));
! 	  unsigned int i;
  
  	  /* Make a copy of the uses into USES_COPY, then cprop into
  	     the use operands.  */
! 	  for (i = 0; i < NUM_USES (uses); i++)
! 	    {
! 	      tree tmp = NULL;
! 
! 	      uses_copy[i] = USE_OP (uses, i);
! 	      if (TREE_CODE (USE_OP (uses, i)) == SSA_NAME)
! 		tmp = get_value_for (USE_OP (uses, i), const_and_copies);
! 	      if (tmp)
! 		SET_USE_OP (uses, i, tmp);
! 	    }
! 
! 	  /* Similarly for virtual uses.  */
! 	  for (i = 0; i < NUM_VUSES (vuses); i++)
  	    {
  	      tree tmp = NULL;
  
! 	      vuses_copy[i] = VUSE_OP (vuses, i);
! 	      if (TREE_CODE (VUSE_OP (vuses, i)) == SSA_NAME)
! 		tmp = get_value_for (VUSE_OP (vuses, i), const_and_copies);
  	      if (tmp)
! 		SET_VUSE_OP (vuses, i, tmp);
! 	    }
  
  	  /* Try to lookup the new expression.  */
  	  cached_lhs = lookup_avail_expr (stmt, NULL, false);
  
  	  /* Restore the statement's original uses/defs.  */
! 	  for (i = 0; i < NUM_USES (uses); i++)
! 	    SET_USE_OP (uses, i, uses_copy[i]);
! 
! 	  for (i = 0; i < NUM_VUSES (vuses); i++)
! 	    SET_VUSE_OP (vuses, i, vuses_copy[i]);
  
  	  free (uses_copy);
- 	  free (vuses_copy);
  
  	  /* If we still did not find the expression in the hash table,
  	     then we can not ignore this statement.  */
--- 728,763 ----
        if (!cached_lhs)
  	{
  	  /* Copy the operands.  */
! 	  unsigned num_uses = (NUM_USES (STMT_USE_OPS (stmt))
! 			       + NUM_VUSES (STMT_VUSE_OPS (stmt)));
! 	  tree *uses_copy = xcalloc (num_uses,  sizeof (tree));
! 	  oii oi;
! 	  unsigned index = 0;
  
  	  /* Make a copy of the uses into USES_COPY, then cprop into
  	     the use operands.  */
! 	  
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_USES_AND_VUSES,
  	    {
+ 	      tree op = oi_op (&oi);
  	      tree tmp = NULL;
  
! 	      uses_copy[index++] = op;
! 	      if (TREE_CODE (op) == SSA_NAME)
! 		tmp = get_value_for (op, const_and_copies);
  	      if (tmp)
! 		oi_set_op (&oi, tmp);
! 	    });
  
  	  /* Try to lookup the new expression.  */
  	  cached_lhs = lookup_avail_expr (stmt, NULL, false);
  
  	  /* Restore the statement's original uses/defs.  */
! 	  index = 0;
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_USES_AND_VUSES,
! 	    oi_set_op (&oi, uses_copy[index++]));
  
  	  free (uses_copy);
  
  	  /* If we still did not find the expression in the hash table,
  	     then we can not ignore this statement.  */
*************** record_equivalences_from_stmt (tree stmt
*** 2669,2675 ****
      {
        tree rhs = TREE_OPERAND (stmt, 1);
        tree new;
-       size_t j;
  
        /* FIXME: If the LHS of the assignment is a bitfield and the RHS
           is a constant, we need to adjust the constant to fit into the
--- 2638,2643 ----
*************** record_equivalences_from_stmt (tree stmt
*** 2694,2701 ****
  
        if (rhs)
  	{
! 	  v_may_def_optype v_may_defs = V_MAY_DEF_OPS (ann);
! 	  v_must_def_optype v_must_defs = V_MUST_DEF_OPS (ann);
  
  	  /* Build a new statement with the RHS and LHS exchanged.  */
  	  new = build (MODIFY_EXPR, TREE_TYPE (stmt), rhs, lhs);
--- 2662,2668 ----
  
        if (rhs)
  	{
! 	  oii oi;
  
  	  /* Build a new statement with the RHS and LHS exchanged.  */
  	  new = build (MODIFY_EXPR, TREE_TYPE (stmt), rhs, lhs);
*************** record_equivalences_from_stmt (tree stmt
*** 2714,2730 ****
  	  /* For each VDEF on the original statement, we want to create a
  	     VUSE of the V_MAY_DEF result or V_MUST_DEF op on the new 
  	     statement.  */
! 	  for (j = 0; j < NUM_V_MAY_DEFS (v_may_defs); j++)
! 	    {
! 	      tree op = V_MAY_DEF_RESULT (v_may_defs, j);
! 	      add_vuse (op, new);
! 	    }
! 	    
! 	  for (j = 0; j < NUM_V_MUST_DEFS (v_must_defs); j++)
! 	    {
! 	      tree op = V_MUST_DEF_OP (v_must_defs, j);
! 	      add_vuse (op, new);
! 	    }
  
  	  finalize_ssa_stmt_operands (new);
  
--- 2681,2688 ----
  	  /* For each VDEF on the original statement, we want to create a
  	     VUSE of the V_MAY_DEF result or V_MUST_DEF op on the new 
  	     statement.  */
! 	  FOR_ANN_OPERANDS (&oi, ann, OI_VDEFS,
! 	    add_vuse (oi_op (&oi), new));
  
  	  finalize_ssa_stmt_operands (new);
  
*************** avail_expr_hash (const void *p)
*** 3269,3276 ****
    stmt_ann_t ann = ((struct expr_hash_elt *)p)->ann;
    tree rhs = ((struct expr_hash_elt *)p)->rhs;
    hashval_t val = 0;
!   size_t i;
!   vuse_optype vuses;
  
    /* iterative_hash_expr knows how to deal with any expression and
       deals with commutative operators as well, so just use it instead
--- 3227,3233 ----
    stmt_ann_t ann = ((struct expr_hash_elt *)p)->ann;
    tree rhs = ((struct expr_hash_elt *)p)->rhs;
    hashval_t val = 0;
!   oii oi;
  
    /* iterative_hash_expr knows how to deal with any expression and
       deals with commutative operators as well, so just use it instead
*************** avail_expr_hash (const void *p)
*** 3287,3295 ****
       because compound variables like arrays are not renamed in the
       operands.  Rather, the rename is done on the virtual variable
       representing all the elements of the array.  */
!   vuses = VUSE_OPS (ann);
!   for (i = 0; i < NUM_VUSES (vuses); i++)
!     val = iterative_hash_expr (VUSE_OP (vuses, i), val);
  
    return val;
  }
--- 3244,3252 ----
       because compound variables like arrays are not renamed in the
       operands.  Rather, the rename is done on the virtual variable
       representing all the elements of the array.  */
! 
!   FOR_ANN_OPERANDS (&oi, ann, (1 << OT_VUSE),
!     val = iterative_hash_expr (oi_op (&oi), val));
  
    return val;
  }
*************** avail_expr_eq (const void *p1, const voi
*** 3362,3398 ****
  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);
!     }
  }
  
--- 3319,3333 ----
  static void
  register_definitions_for_stmt (stmt_ann_t ann, varray_type *block_defs_p)
  {
!   oii oi;
  
!   FOR_ANN_OPERANDS (&oi, ann, OI_ALL_DEFS,
      {
!       tree def = oi_op (&oi);
  
        /* 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-dse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dse.c,v
retrieving revision 2.4
diff -c -3 -p -r2.4 tree-ssa-dse.c
*** tree-ssa-dse.c	17 Jun 2004 18:13:18 -0000	2.4
--- tree-ssa-dse.c	24 Jun 2004 21:40:46 -0000
*************** need_imm_uses_for (tree var)
*** 115,139 ****
  static void
  fix_phi_uses (tree phi, tree stmt)
  {
!   stmt_ann_t ann = stmt_ann (stmt);
!   v_may_def_optype v_may_defs;
!   unsigned int i;
    int j;
  
    get_stmt_operands (stmt);
-   v_may_defs = V_MAY_DEF_OPS (ann);
  
    /* Walk each V_MAY_DEF in STMT.  */
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
      {
!       tree v_may_def = V_MAY_DEF_RESULT (v_may_defs, i);
  
        /* Find any uses in the PHI which match V_MAY_DEF and replace
  	 them with the appropriate V_MAY_DEF_OP.  */
        for (j = 0; j < PHI_NUM_ARGS (phi); j++)
  	if (v_may_def == PHI_ARG_DEF (phi, j))
! 	  SET_PHI_ARG_DEF (phi, j, V_MAY_DEF_OP (v_may_defs, i));
!     }
  }
  
  /* Replace the V_MAY_DEF_OPs in STMT1 which match V_MAY_DEF_RESULTs 
--- 115,138 ----
  static void
  fix_phi_uses (tree phi, tree stmt)
  {
!   oii oi;
    int j;
  
    get_stmt_operands (stmt);
  
    /* Walk each V_MAY_DEF in STMT.  */
! 
!   FOR_STMT_OPERANDS (&oi, stmt, OI_V_MAY_DEFS,
      {
!       tree v_may_def = oi_op (&oi);
!       tree v_may_use = USE_FROM_PTR (oi_use_ptr_from_vdef_def (&oi));
  
        /* Find any uses in the PHI which match V_MAY_DEF and replace
  	 them with the appropriate V_MAY_DEF_OP.  */
        for (j = 0; j < PHI_NUM_ARGS (phi); j++)
  	if (v_may_def == PHI_ARG_DEF (phi, j))
! 	  SET_PHI_ARG_DEF (phi, j, v_may_use);
!     });
  }
  
  /* Replace the V_MAY_DEF_OPs in STMT1 which match V_MAY_DEF_RESULTs 
*************** fix_phi_uses (tree phi, tree stmt)
*** 142,182 ****
  static void
  fix_stmt_v_may_defs (tree stmt1, tree stmt2)
  {
!   stmt_ann_t ann1 = stmt_ann (stmt1);
!   stmt_ann_t ann2 = stmt_ann (stmt2);
!   v_may_def_optype v_may_defs1;
!   v_may_def_optype v_may_defs2;
!   unsigned int i, j;
! 
!   get_stmt_operands (stmt1);
!   get_stmt_operands (stmt2);
!   v_may_defs1 = V_MAY_DEF_OPS (ann1);
!   v_may_defs2 = V_MAY_DEF_OPS (ann2);
  
    /* Walk each V_MAY_DEF_OP in stmt1.  */
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs1); i++)
      {
!       tree v_may_def1 = V_MAY_DEF_OP (v_may_defs1, i);
  
        /* Find the appropriate V_MAY_DEF_RESULT in STMT2.  */
!       for (j = 0; j < NUM_V_MAY_DEFS (v_may_defs2); j++)
  	{
! 	  if (v_may_def1 == V_MAY_DEF_RESULT (v_may_defs2, j))
  	    {
  	      /* Update.  */
! 	      SET_V_MAY_DEF_OP (v_may_defs1, i, V_MAY_DEF_OP (v_may_defs2, j));
  	      break;
  	    }
! 	}
  
- #ifdef ENABLE_CHECKING
        /* If we did not find a corresponding V_MAY_DEF_RESULT, then something
  	 has gone terribly wrong.  */
!       if (j == NUM_V_MAY_DEFS (v_may_defs2))
  	abort ();
! #endif
! 
!     }
  }
  
  
--- 141,170 ----
  static void
  fix_stmt_v_may_defs (tree stmt1, tree stmt2)
  {
!   oii oi1, oi2;
  
    /* Walk each V_MAY_DEF_OP in stmt1.  */
!   FOR_STMT_OPERANDS (&oi1, stmt1, (1 << OT_VDEF_USE),
      {
!       tree v_may_def1 = oi_op (&oi1);
  
        /* Find the appropriate V_MAY_DEF_RESULT in STMT2.  */
!       FOR_STMT_OPERANDS (&oi2, stmt2, (1 << OT_VDEF_USE),
  	{
! 	  tree v_may_def2 = DEF_FROM_PTR (oi_def_ptr_from_vdef_use (&oi2));
! 	  if (v_may_def1 == v_may_def2)
  	    {
  	      /* Update.  */
! 	      oi_set_op (&oi1, oi_op (&oi2));
  	      break;
  	    }
! 	});
  
        /* If we did not find a corresponding V_MAY_DEF_RESULT, then something
  	 has gone terribly wrong.  */
!       if (oi_end_p (&oi2))
  	abort ();
!     });
  }
  
  
*************** dse_optimize_stmt (struct dom_walk_data 
*** 234,247 ****
    struct dse_global_data *dse_gd = walk_data->global_data;
    tree stmt = bsi_stmt (bsi);
    stmt_ann_t ann = stmt_ann (stmt);
-   v_may_def_optype v_may_defs;
  
    get_stmt_operands (stmt);
-   v_may_defs = V_MAY_DEF_OPS (ann);
  
    /* If this statement has no virtual uses, then there is nothing
       to do.  */
!   if (NUM_V_MAY_DEFS (v_may_defs) == 0)
      return;
  
    /* We know we have virtual definitions.  If this is a MODIFY_EXPR, then
--- 222,233 ----
    struct dse_global_data *dse_gd = walk_data->global_data;
    tree stmt = bsi_stmt (bsi);
    stmt_ann_t ann = stmt_ann (stmt);
  
    get_stmt_operands (stmt);
  
    /* If this statement has no virtual uses, then there is nothing
       to do.  */
!   if (NUM_V_MAY_DEFS (V_MAY_DEF_OPS (ann)) == 0)
      return;
  
    /* We know we have virtual definitions.  If this is a MODIFY_EXPR, then
Index: tree-ssa-live.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-live.c,v
retrieving revision 2.10
diff -c -3 -p -r2.10 tree-ssa-live.c
*** tree-ssa-live.c	17 Jun 2004 18:13:18 -0000	2.10
--- tree-ssa-live.c	24 Jun 2004 21:40:46 -0000
*************** create_ssa_var_map (int flags)
*** 294,312 ****
  {
    block_stmt_iterator bsi;
    basic_block bb;
!   tree dest, use;
    tree stmt;
-   stmt_ann_t ann;
-   vuse_optype vuses;
-   v_may_def_optype v_may_defs;
-   v_must_def_optype v_must_defs;
-   use_optype uses;
-   def_optype defs;
-   unsigned x;
    var_map map;
  #if defined ENABLE_CHECKING
!   sbitmap used_in_real_ops;
!   sbitmap used_in_virtual_ops;
  #endif
  
    map = init_var_map (num_ssa_names + 1);
--- 294,309 ----
  {
    block_stmt_iterator bsi;
    basic_block bb;
!   tree use;
    tree stmt;
    var_map map;
+   oii oi;
+   bool enabled_checking = false;
+   sbitmap used_in_real_ops = NULL;
+   sbitmap used_in_virtual_ops = NULL;
+ 
  #if defined ENABLE_CHECKING
!   enabled_checking = true;
  #endif
  
    map = init_var_map (num_ssa_names + 1);
*************** create_ssa_var_map (int flags)
*** 345,409 ****
          {
  	  stmt = bsi_stmt (bsi);
  	  get_stmt_operands (stmt);
- 	  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);
! 
! #if defined ENABLE_CHECKING
! 	      SET_BIT (used_in_real_ops, var_ann (SSA_NAME_VAR (use))->uid);
! #endif
! 	    }
! 
! 	  defs = DEF_OPS (ann);
! 	  for (x = 0; x < NUM_DEFS (defs); x++)
  	    {
! 	      dest = DEF_OP (defs, x);
! 	      register_ssa_partition (map, dest, false);
  
! #if defined ENABLE_CHECKING
! 	      SET_BIT (used_in_real_ops, var_ann (SSA_NAME_VAR (dest))->uid);
! #endif
! 	    }
  
  	  /* While we do not care about virtual operands for
  	     out of SSA, we do need to look at them to make sure
  	     we mark all the variables which are used.  */
! 	  vuses = VUSE_OPS (ann);
! 	  for (x = 0; x < NUM_VUSES (vuses); x++)
! 	    {
! 	      tree var = VUSE_OP (vuses, x);
! 	      set_is_used (var);
! 
! #if defined ENABLE_CHECKING
! 	      SET_BIT (used_in_virtual_ops, var_ann (SSA_NAME_VAR (var))->uid);
! #endif
! 	    }
! 
! 	  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_is_used (var);
  
! #if defined ENABLE_CHECKING
! 	      SET_BIT (used_in_virtual_ops, var_ann (SSA_NAME_VAR (var))->uid);
! #endif
! 	    }
! 	    
! 	  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_is_used (var);
! #if defined ENABLE_CHECKING
! 	      SET_BIT (used_in_virtual_ops, var_ann (SSA_NAME_VAR (var))->uid);
! #endif
! 	    }	    
  	}
      }
  
--- 342,369 ----
          {
  	  stmt = bsi_stmt (bsi);
  	  get_stmt_operands (stmt);
  
  	  /* Register USE and DEF operands in each statement.  */
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_ALL_REAL,
  	    {
! 	      use = oi_op (&oi);
! 	      register_ssa_partition (map, use, !oi_def_p (&oi));
  
! 	      if (enabled_checking)
! 		SET_BIT (used_in_real_ops, var_ann (SSA_NAME_VAR (use))->uid);
! 	    });
  
  	  /* While we do not care about virtual operands for
  	     out of SSA, we do need to look at them to make sure
  	     we mark all the variables which are used.  */
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_ALL_VIRTUAL,
  	    {
! 	      tree var = oi_op (&oi);
  	      set_is_used (var);
  
! 	      if (enabled_checking)
! 		SET_BIT (used_in_virtual_ops, var_ann (SSA_NAME_VAR (var))->uid);
! 	    });
  	}
      }
  
*************** calculate_live_on_entry (var_map map)
*** 562,574 ****
    basic_block bb;
    bitmap saw_def;
    tree phi, var, stmt;
-   tree op;
    edge e;
    varray_type stack;
    block_stmt_iterator bsi;
-   use_optype uses;
-   def_optype defs;
-   stmt_ann_t ann;
  
    saw_def = BITMAP_XMALLOC ();
  
--- 522,530 ----
*************** calculate_live_on_entry (var_map map)
*** 611,635 ****
  
        for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
          {
  	  stmt = bsi_stmt (bsi);
  	  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);
! 	    }
  	}
      }
  
--- 567,582 ----
  
        for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
          {
+ 	  oii oi;
+ 
  	  stmt = bsi_stmt (bsi);
  	  get_stmt_operands (stmt);
  
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_USES,
! 	    add_livein_if_notdef (live, saw_def, oi_op (&oi), bb));
  
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_DEFS,
! 	    set_if_valid (map, saw_def, oi_op (&oi)));
  	}
      }
  
*************** build_tree_conflict_graph (tree_live_inf
*** 1311,1321 ****
    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);
--- 1258,1266 ----
    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;
  
    map = live_var_map (liveinfo);
*************** build_tree_conflict_graph (tree_live_inf
*** 1342,1351 ****
          {
  	  bool is_a_copy = false;
  	  tree stmt = bsi_stmt (bsi);
- 	  stmt_ann_t ann;
  
  	  get_stmt_operands (stmt);
- 	  ann = stmt_ann (stmt);
  
  	  /* A copy between 2 partitions does not introduce an interference 
  	     by itself.  If they did, you would never be able to coalesce 
--- 1287,1294 ----
*************** build_tree_conflict_graph (tree_live_inf
*** 1393,1415 ****
  
  	  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);
! 		}
  	    }
  	}
  
--- 1336,1348 ----
  
  	  if (!is_a_copy)
  	    {
! 	      oii oi;
  
! 	      FOR_STMT_OPERANDS (&oi, stmt, OI_DEFS,
! 		add_conflicts_if_valid (tpa, graph, map, live, oi_op (&oi)));
  
! 	      FOR_STMT_OPERANDS (&oi, stmt, OI_USES,
!       		set_if_valid (map, live, oi_op (&oi)));
  	    }
  	}
  
*************** register_ssa_partitions_for_vars (bitmap
*** 1870,1898 ****
  	     statement in this block.  */
  	  for (bsi = bsi_start (bb); ! bsi_end_p (bsi); bsi_next (&bsi))
  	    {
! 	      stmt_ann_t ann = stmt_ann (bsi_stmt (bsi));
! 	      use_optype uses = USE_OPS (ann);
! 	      def_optype defs = DEF_OPS (ann);
! 	      unsigned int i;
  
! 	      for (i = 0; i < NUM_USES (uses); i++)
  		{
! 		  tree op = USE_OP (uses, i);
  
  		  if (TREE_CODE (op) == SSA_NAME
  		      && bitmap_bit_p (vars, var_ann (SSA_NAME_VAR (op))->uid))
! 		    register_ssa_partition (map, op, 1);
! 		}
! 		    
! 	      for (i = 0; i < NUM_DEFS (defs); i++)
! 		{
! 		  tree op = DEF_OP (defs, i);
! 
! 		  if (TREE_CODE (op) == SSA_NAME
! 			  && bitmap_bit_p (vars,
! 			     var_ann (SSA_NAME_VAR (op))->uid))
! 		    register_ssa_partition (map, op, 0);
! 		}
  	    }
  	}
      }
--- 1803,1818 ----
  	     statement in this block.  */
  	  for (bsi = bsi_start (bb); ! bsi_end_p (bsi); bsi_next (&bsi))
  	    {
! 	      oii oi;
  
! 	      FOR_STMT_OPERANDS (&oi, bsi_stmt (bsi), OI_ALL_REAL,
  		{
! 		  tree op = oi_op (&oi);
  
  		  if (TREE_CODE (op) == SSA_NAME
  		      && bitmap_bit_p (vars, var_ann (SSA_NAME_VAR (op))->uid))
! 		    register_ssa_partition (map, op, !oi_def_p (&oi));
! 		});
  	    }
  	}
      }
Index: tree-ssa-loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop.c,v
retrieving revision 2.5
diff -c -3 -p -r2.5 tree-ssa-loop.c
*** tree-ssa-loop.c	17 Jun 2004 18:13:18 -0000	2.5
--- tree-ssa-loop.c	24 Jun 2004 21:40:46 -0000
*************** mark_defs_for_rewrite (basic_block bb)
*** 102,113 ****
  {
    tree stmt, var;
    block_stmt_iterator bsi;
!   stmt_ann_t ann;
!   def_optype defs;
!   v_may_def_optype v_may_defs;
!   vuse_optype vuses;
!   v_must_def_optype v_must_defs;
!   unsigned i;
  
    for (stmt = phi_nodes (bb); stmt; stmt = PHI_CHAIN (stmt))
      {
--- 102,108 ----
  {
    tree stmt, var;
    block_stmt_iterator bsi;
!   oii oi;
  
    for (stmt = phi_nodes (bb); stmt; stmt = PHI_CHAIN (stmt))
      {
*************** mark_defs_for_rewrite (basic_block bb)
*** 126,137 ****
      {
        stmt = bsi_stmt (bsi);
        get_stmt_operands (stmt);
-       ann = stmt_ann (stmt);
  
!       defs = DEF_OPS (ann);
!       for (i = 0; i < NUM_DEFS (defs); i++)
  	{
! 	  var = SSA_NAME_VAR (DEF_OP (defs, i));
  	  bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
  
  	  /* If we have a type_mem_tag, add it as well.  Due to rewriting the
--- 121,130 ----
      {
        stmt = bsi_stmt (bsi);
        get_stmt_operands (stmt);
  
!       FOR_STMT_OPERANDS (&oi, stmt, OI_ALL_DEFS | OI_VUSES,
  	{
! 	  var = SSA_NAME_VAR (oi_op (&oi));
  	  bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
  
  	  /* If we have a type_mem_tag, add it as well.  Due to rewriting the
*************** mark_defs_for_rewrite (basic_block bb)
*** 140,171 ****
  	  var = var_ann (var)->type_mem_tag;
  	  if (var)
  	    bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
! 	}
! 
!       v_may_defs = V_MAY_DEF_OPS (ann);
!       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 = V_MUST_DEF_OPS (ann);
!       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);
! 	}
! 
!       /* We also need to rewrite vuses, since we will copy the statements
! 	 and the ssa versions could not be recovered in the copy.  We do
! 	 not have to do this for operands of V_MAY_DEFS explicitly, since
! 	 they have the same underlying variable as the results.  */
!       vuses = VUSE_OPS (ann);
!       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);
! 	}
      }
  }
  
--- 133,139 ----
  	  var = var_ann (var)->type_mem_tag;
  	  if (var)
  	    bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
! 	});
      }
  }
  
Index: tree-ssa-operands.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.h,v
retrieving revision 2.3
diff -c -3 -p -r2.3 tree-ssa-operands.h
*** tree-ssa-operands.h	17 Jun 2004 18:13:19 -0000	2.3
--- tree-ssa-operands.h	24 Jun 2004 21:40:46 -0000
*************** extern void remove_vuses (tree);
*** 165,168 ****
--- 165,262 ----
  extern void remove_v_may_defs (tree);
  extern void remove_v_must_defs (tree);
  
+ /* Types of operators.  */
+ enum oi_op_type
+ {
+   OT_DEF,
+   OT_USE,
+   OT_VDEF_DEF,
+   OT_VDEF_USE,
+   OT_VMUST_DEF,
+   OT_VUSE
+ };
+ 
+ #define OI_USES (1 << OT_USE)
+ #define OI_VUSES ((1 << OT_VUSE) | (1 << OT_VDEF_USE))
+ #define OI_USES_AND_VUSES ((1 << OT_USE) | (1 << OT_VUSE))
+ #define OI_ALL_USES (OI_USES | OI_VUSES)
+ 
+ #define OI_V_MAY_DEFS (1 << OT_VDEF_DEF)
+ 
+ #define OI_DEFS (1 << OT_DEF)
+ #define OI_VDEFS ((1 << OT_VDEF_DEF) | (1 << OT_VMUST_DEF))
+ #define OI_ALL_DEFS (OI_DEFS | OI_VDEFS)
+ 
+ #define OI_ALL_REAL (OI_USES | OI_DEFS)
+ #define OI_ALL_VIRTUAL (OI_VUSES | OI_VDEFS)
+ 
+ /* The operator structures.  */
+ union op_strs
+ {
+   use_optype uses;
+   vuse_optype vuses;
+   def_optype defs;
+   v_may_def_optype v_may_defs;
+   v_must_def_optype v_must_defs;
+ };
+ 
+ /* Operator iterator.  */
+ struct op_iterator
+ {
+   enum oi_op_type type;		/* Type of the current operand.  */
+   unsigned aop;			/* The actual operand.  */
+   unsigned aop_max;		/* The maximal operand number.  */
+   union op_strs aops;		/* The structure for operands of the actual type.  */
+ };
+ 
+ typedef struct op_iterator oii;
+ 
+ #define FOR_STMT_OPERANDS(OI, STMT, TYPES, CODE) \
+   FOR_ANN_OPERANDS (OI, stmt_ann (STMT), TYPES, CODE)
+ 
+ #define FOR_ANN_OPERANDS(OI, ANN, TYPES, CODE)		\
+   do							\
+     {							\
+       struct stmt_ann_d *_ann = (ANN);			\
+       unsigned _types = (TYPES);			\
+       if ((1 << OT_DEF) & _types)			\
+ 	FOR_OPS_TYPE (OI, _ann, OT_DEF, CODE)		\
+       if ((1 << OT_USE) & _types)			\
+ 	FOR_OPS_TYPE (OI, _ann, OT_USE, CODE)		\
+       if ((1 << OT_VDEF_DEF) & _types)			\
+ 	FOR_OPS_TYPE (OI, _ann, OT_VDEF_DEF, CODE)	\
+       if ((1 << OT_VDEF_USE) & _types)			\
+ 	FOR_OPS_TYPE (OI, _ann, OT_VDEF_USE, CODE)	\
+       if ((1 << OT_VMUST_DEF) & _types)			\
+ 	FOR_OPS_TYPE (OI, _ann, OT_VMUST_DEF, CODE)	\
+       if ((1 << OT_VUSE) & _types)			\
+ 	FOR_OPS_TYPE (OI, _ann, OT_VUSE, CODE)		\
+     } while (0)
+ 
+ #define FOR_OPS_TYPE(OI, ANN, TYPE, CODE)		\
+   {							\
+     bool _was_break = true;				\
+ 							\
+     for (oi_init (OI, ANN, TYPE);			\
+ 	 !oi_end_p (OI) || (_was_break = false);	\
+ 	 oi_next (OI))					\
+       CODE;						\
+ 							\
+     if (_was_break)					\
+       break;						\
+   }
+ 
+ struct stmt_ann_d;
+ static inline void oi_init (struct op_iterator *, struct stmt_ann_d *, enum oi_op_type);
+ static inline bool oi_end_p (const struct op_iterator *);
+ static inline void oi_next (struct op_iterator *);
+ static inline tree oi_op (const struct op_iterator *);
+ static inline void oi_set_op (struct op_iterator *, tree);
+ static inline bool oi_def_p (const struct op_iterator *);
+ static inline bool oi_virtual_p (const struct op_iterator *);
+ static inline use_operand_p oi_use_ptr (const struct op_iterator *);
+ static inline def_operand_p oi_def_ptr (const struct op_iterator *);
+ static inline use_operand_p oi_use_ptr_from_vdef_def (const struct op_iterator *);
+ static inline def_operand_p oi_def_ptr_from_vdef_use (const struct op_iterator *);
+ 
  #endif  /* GCC_TREE_SSA_OPERANDS_H  */
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa.c,v
retrieving revision 2.15
diff -c -3 -p -r2.15 tree-ssa.c
*** tree-ssa.c	23 Jun 2004 20:12:43 -0000	2.15
--- tree-ssa.c	24 Jun 2004 21:40:46 -0000
*************** verify_ssa (void)
*** 293,298 ****
--- 293,299 ----
    bool err = false;
    basic_block bb;
    basic_block *definition_block = xcalloc (num_ssa_names, sizeof (basic_block));
+   oii oi;
  
    timevar_push (TV_TREE_SSA_VERIFY);
  
*************** verify_ssa (void)
*** 312,333 ****
  	{
  	  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 ("Makes aliased stores, but no V_MAY_DEFS");
! 	    
! 	  for (j = 0; j < NUM_V_MAY_DEFS (v_may_defs); j++)
  	    {
! 	      tree op = V_MAY_DEF_RESULT (v_may_defs, j);
  	      if (is_gimple_reg (op))
  		{
  		  error ("Found a virtual definition for a GIMPLE register");
--- 313,330 ----
  	{
  	  tree stmt;
  	  stmt_ann_t ann;
  
  	  stmt = bsi_stmt (bsi);
  	  ann = stmt_ann (stmt);
  	  get_stmt_operands (stmt);
  
! 	  if (ann->makes_aliased_stores
! 	      && NUM_V_MAY_DEFS (V_MAY_DEF_OPS (ann)) == 0)
  	    error ("Makes aliased stores, but no V_MAY_DEFS");
! 
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_V_MAY_DEFS,
  	    {
! 	      tree op = oi_op (&oi);
  	      if (is_gimple_reg (op))
  		{
  		  error ("Found a virtual definition for a GIMPLE register");
*************** verify_ssa (void)
*** 336,347 ****
  		  err = true;
  		}
  	      err |= verify_def (bb, definition_block, op, stmt);
! 	    }
            
! 	  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 (is_gimple_reg (op))
  		{
  		  error ("Found a virtual must-def for a GIMPLE register");
--- 333,343 ----
  		  err = true;
  		}
  	      err |= verify_def (bb, definition_block, op, stmt);
! 	    });
            
! 	  FOR_STMT_OPERANDS (&oi, stmt, 1 << OT_VMUST_DEF,
  	    {
! 	      tree op = oi_op (&oi);
  	      if (is_gimple_reg (op))
  		{
  		  error ("Found a virtual must-def for a GIMPLE register");
*************** verify_ssa (void)
*** 350,361 ****
  		  err = true;
  		}
  	      err |= verify_def (bb, definition_block, op, stmt);
! 	    }
  
! 	  defs = DEF_OPS (ann);
! 	  for (j = 0; j < NUM_DEFS (defs); j++)
  	    {
! 	      tree op = DEF_OP (defs, j);
  	      if (TREE_CODE (op) == SSA_NAME && !is_gimple_reg (op))
  		{
  		  error ("Found a real definition for a non-GIMPLE register");
--- 346,356 ----
  		  err = true;
  		}
  	      err |= verify_def (bb, definition_block, op, stmt);
! 	    });
  
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_DEFS,
  	    {
! 	      tree op = oi_op (&oi);
  	      if (TREE_CODE (op) == SSA_NAME && !is_gimple_reg (op))
  		{
  		  error ("Found a real definition for a non-GIMPLE register");
*************** verify_ssa (void)
*** 364,370 ****
  		  err = true;
  		}
  	      err |= verify_def (bb, definition_block, op, stmt);
! 	    }
  	}
      }
  
--- 359,365 ----
  		  err = true;
  		}
  	      err |= verify_def (bb, definition_block, op, stmt);
! 	      });
  	}
      }
  
*************** verify_ssa (void)
*** 398,413 ****
        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 (is_gimple_reg (op))
  		{
--- 393,402 ----
        for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
  	{
  	  tree stmt = bsi_stmt (bsi);
  
! 	  FOR_STMT_OPERANDS (&oi, stmt, 1 << OT_VUSE,
  	    {
! 	      tree op = oi_op (&oi);
  
  	      if (is_gimple_reg (op))
  		{
*************** verify_ssa (void)
*** 418,429 ****
  		}
  	      err |= verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
  				 op, stmt, false);
! 	    }
  
! 	  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 (is_gimple_reg (op))
  		{
--- 407,417 ----
  		}
  	      err |= verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
  				 op, stmt, false);
! 	    });
  
! 	  FOR_STMT_OPERANDS (&oi, stmt, 1 << OT_VDEF_USE,
  	    {
! 	      tree op = oi_op (&oi);
  
  	      if (is_gimple_reg (op))
  		{
*************** verify_ssa (void)
*** 434,445 ****
  		}
  	      err |= verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
  				 op, stmt, false);
! 	    }
  
! 	  uses = USE_OPS (ann);
! 	  for (j = 0; j < NUM_USES (uses); j++)
  	    {
! 	      tree op = USE_OP (uses, j);
  
  	      if (TREE_CODE (op) == SSA_NAME && !is_gimple_reg (op))
  		{
--- 422,432 ----
  		}
  	      err |= verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
  				 op, stmt, false);
! 	    });
  
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_USES,
  	    {
! 	      tree op = oi_op (&oi);
  
  	      if (TREE_CODE (op) == SSA_NAME && !is_gimple_reg (op))
  		{
*************** verify_ssa (void)
*** 450,456 ****
  		}
  	      err |= verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
  				 op, stmt, false);
! 	    }
  	}
      }
  
--- 437,443 ----
  		}
  	      err |= verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
  				 op, stmt, false);
! 	    });
  	}
      }
  
*************** propagate_into_addr (tree stmt, tree var
*** 750,763 ****
  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);
--- 737,747 ----
  static void
  replace_immediate_uses (tree var, tree repl)
  {
!   int i, n;
    dataflow_t df;
    tree stmt;
    bool mark_new_vars;
+   oii oi;
  
    df = get_immediate_uses (SSA_NAME_DEF_STMT (var));
    n = num_immediate_uses (df);
*************** replace_immediate_uses (tree var, tree r
*** 765,774 ****
    for (i = 0; i < n; i++)
      {
        stmt = immediate_use (df, i);
-       ann = stmt_ann (stmt);
  
        if (TREE_CODE (stmt) == PHI_NODE)
  	{
  	  for (j = 0; j < PHI_NUM_ARGS (stmt); j++)
  	    if (PHI_ARG_DEF (stmt, j) == var)
  	      {
--- 749,759 ----
    for (i = 0; i < n; i++)
      {
        stmt = immediate_use (df, i);
  
        if (TREE_CODE (stmt) == PHI_NODE)
  	{
+ 	  int j;
+ 
  	  for (j = 0; j < PHI_NUM_ARGS (stmt); j++)
  	    if (PHI_ARG_DEF (stmt, j) == var)
  	      {
*************** replace_immediate_uses (tree var, tree r
*** 791,815 ****
  	      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
--- 776,796 ----
  	      propagate_into_addr (stmt, var, &TREE_OPERAND (stmt, 1), repl);
  	    }
  
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_USES,
! 	    if (oi_op (&oi) == var)
  	      {
! 		propagate_value (oi_use_ptr (&oi), repl);
  		mark_new_vars = POINTER_TYPE_P (TREE_TYPE (repl));
! 	      });
  	}
        else
  	{
! 	  FOR_STMT_OPERANDS (&oi, stmt, OI_VUSES,
! 	    if (oi_op (&oi) == var)
! 	      {
! 		propagate_value (oi_use_ptr (&oi), repl);
! 		mark_new_vars = POINTER_TYPE_P (TREE_TYPE (repl));
! 	      });
  	}
  
        /* If REPL is a pointer, it may have different memory tags associated
Index: tree-tailcall.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-tailcall.c,v
retrieving revision 2.12
diff -c -3 -p -r2.12 tree-tailcall.c
*** tree-tailcall.c	18 Jun 2004 14:05:20 -0000	2.12
--- tree-tailcall.c	24 Jun 2004 21:40:46 -0000
*************** eliminate_tail_call (struct tailcall *t)
*** 644,652 ****
    basic_block bb, first;
    edge e;
    tree phi;
    stmt_ann_t ann;
-   v_may_def_optype v_may_defs;
-   unsigned i;
  
    stmt = bsi_stmt (t->call_bsi);
    get_stmt_operands (stmt);
--- 644,651 ----
    basic_block bb, first;
    edge e;
    tree phi;
+   oii oi;
    stmt_ann_t ann;
  
    stmt = bsi_stmt (t->call_bsi);
    get_stmt_operands (stmt);
*************** eliminate_tail_call (struct tailcall *t)
*** 697,706 ****
      }
  
    /* Add phi nodes for the call clobbered variables.  */
!   v_may_defs = V_MAY_DEF_OPS (ann);
!   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
      {
!       param = SSA_NAME_VAR (V_MAY_DEF_RESULT (v_may_defs, i));
        for (phi = phi_nodes (first); phi; phi = PHI_CHAIN (phi))
  	if (param == SSA_NAME_VAR (PHI_RESULT (phi)))
  	  break;
--- 696,706 ----
      }
  
    /* Add phi nodes for the call clobbered variables.  */
!   FOR_ANN_OPERANDS (&oi, ann, OI_V_MAY_DEFS,
      {
!       tree use;
! 
!       param = SSA_NAME_VAR (oi_op (&oi));
        for (phi = phi_nodes (first); phi; phi = PHI_CHAIN (phi))
  	if (param == SSA_NAME_VAR (PHI_RESULT (phi)))
  	  break;
*************** eliminate_tail_call (struct tailcall *t)
*** 722,729 ****
  	    abort ();
  	}
  
!       add_phi_arg (&phi, V_MAY_DEF_OP (v_may_defs, i), e);
!     }
  
    /* Update the values of accumulators.  */
    adjust_accumulator_values (t->call_bsi, t->mult, t->add, e);
--- 722,730 ----
  	    abort ();
  	}
  
!       use = USE_FROM_PTR (oi_use_ptr_from_vdef_def (&oi));
!       add_phi_arg (&phi, use, e);
!     });
  
    /* Update the values of accumulators.  */
    adjust_accumulator_values (t->call_bsi, t->mult, t->add, e);



More information about the Gcc-patches mailing list