This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] modify_stmt() usage and lazy updating of operands.


We have been a bit loose with how we use modify_stmt(). Of course it
hasn't really mattered yet.  There are many places that assume that we
are doing lazy updating of a stmt, and mark the stmt as modifed before
actually changing the stmt.  This patch goes through and fixes up those
spots such that modify_stmt() is called after the stmt changes are made.

Which brings up the subject of lazy updating.  The *vast* majority of
cases in the optimizers dont actually need lazy updating, once a stmt is
changed we move on. In order for an integrated immediate uses to be
accurate, there cannot be any pending stmts waiting to be processing
lazily.
for instance, if you add a use of a_8 to a stmt

   a_7 = a_8 + 1

and mark it modified, the immediate uses information is not up to date
for a_8 until get_stmt_operands() is called.  

The longer term plan is to actually make modify_stmt() call
get_stmt_operands() and keep the information up to date. Furthermore,
calling modify_stmt() should only be necessary when an optimization is
manipulating the trees directly rather than through the operand cache.
Although we don't actually do it yet, the SET_* operands routines
already have enough information to decide whether get_stmt_operands()
needs to be called or not. This is just further work to be flushed out,
but isn't critical.

DOM also had a bunch of places where it was setting the modified bit
directly. I've reworked those routines to call modify_stmt instead, and
I've also made changes such that when "artificial" stmts are created for
the hash table, they don't get marked via modify_stmt.  Modify_stmt
should only be called on stmts which actually occur in the program,
otherwise the immediate_uses info isn't going to make much sense.

Ther are a few places where calls to modify_stmt were redundant as well,
so I removed them.

These changes bootstrap on i686-pc-linux-gnu and cause no new failures
in the testsuites. (Well, at least on a toolchain from a few days ago).
The bootstrap/make-check process is currently running on todays
toolchain. I should have the results later tonight.

Since Im waiting for the current results, Its unlikely to be checked in
before tomorrow.

Does anyone have any issues with any of this?

Andrew


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

	* tree-cfg.c (bsi_insert_before, bsi_insert_after): Call modify_stmt
	after linking stmt into the program.
	(bsi_remove): Don't call modify_stmt.
	* tree-complex.c (update_complex_assignment, 
	expand_complex_comparison): Call modify_stmt after changing the stmt.
	* tree-outof-ssa.c (rewrite_trees): Call modify_stmt only if not 
	removing the stmt.
	(rewrite_vars_out_of_ssa): Don't call modify_stmt after insert_on_edge.
	* tree-ssa-ccp.c (substitute_and_fold): Call modify_stmt after changing
	the stmt, and only if needed.
	* tree-ssa-dom.c (thread_across_edge): Pass no annotation for a dummy
	expression.
	(simplify_rhs_and_lookup_avail_expr): Don't take an annotation param.
	(simplify_cond_and_lookup_avail_expr): Use modify_stmt.
	(simplify_switch_and_lookup_avail_expr): Don't take an annotation param.
	(eliminate_redundant_computations): Don't pass an annotation. Call 
	modify_stmt rather than setting the annotation directly.
	(record_equivalences_from_stmt): Remove unused local 'j'.
	(cprop_operand): Take a stmt rather than an annotation as a parameter.
	Call modify_stmt.
	(cprop_into_stmt): Pass stmt rather than annotation.
	(update_rhs_and_lookup_avail_expr): Call modify_stmt.
	* tree-ssa-loop-im.c (schedule_sm): Call get_stmt_ann rather than 
	modify_stmt.
	* tree-ssa.c (propagate_into_addr): Dont call modify_stmt.



Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.36
diff -c -p -r2.36 tree-cfg.c
*** tree-cfg.c	23 Jul 2004 22:37:22 -0000	2.36
--- tree-cfg.c	4 Aug 2004 15:42:13 -0000
*************** void
*** 2810,2817 ****
  bsi_insert_before (block_stmt_iterator *i, tree t, enum bsi_iterator_update m)
  {
    set_bb_for_stmt (t, i->bb);
-   modify_stmt (t);
    tsi_link_before (&i->tsi, t, m);
  }
  
  
--- 2810,2817 ----
  bsi_insert_before (block_stmt_iterator *i, tree t, enum bsi_iterator_update m)
  {
    set_bb_for_stmt (t, i->bb);
    tsi_link_before (&i->tsi, t, m);
+   modify_stmt (t);
  }
  
  
*************** void
*** 2823,2830 ****
  bsi_insert_after (block_stmt_iterator *i, tree t, enum bsi_iterator_update m)
  {
    set_bb_for_stmt (t, i->bb);
-   modify_stmt (t);
    tsi_link_after (&i->tsi, t, m);
  }
  
  
--- 2823,2830 ----
  bsi_insert_after (block_stmt_iterator *i, tree t, enum bsi_iterator_update m)
  {
    set_bb_for_stmt (t, i->bb);
    tsi_link_after (&i->tsi, t, m);
+   modify_stmt (t);
  }
  
  
*************** bsi_remove (block_stmt_iterator *i)
*** 2836,2842 ****
  {
    tree t = bsi_stmt (*i);
    set_bb_for_stmt (t, NULL);
-   modify_stmt (t);
    tsi_delink (&i->tsi);
  }
  
--- 2836,2841 ----
Index: tree-complex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-complex.c,v
retrieving revision 2.6
diff -c -p -r2.6 tree-complex.c
*** tree-complex.c	22 Jul 2004 08:20:37 -0000	2.6
--- tree-complex.c	4 Aug 2004 15:42:13 -0000
*************** update_complex_assignment (block_stmt_it
*** 78,89 ****
    tree stmt = bsi_stmt (*bsi);
    tree type;
  
-   modify_stmt (stmt);
    if (TREE_CODE (stmt) == RETURN_EXPR)
      stmt = TREE_OPERAND (stmt, 0);
    
    type = TREE_TYPE (TREE_OPERAND (stmt, 1));
    TREE_OPERAND (stmt, 1) = build (COMPLEX_EXPR, type, r, i);
  }
  
  /* Expand complex addition to scalars:
--- 78,89 ----
    tree stmt = bsi_stmt (*bsi);
    tree type;
  
    if (TREE_CODE (stmt) == RETURN_EXPR)
      stmt = TREE_OPERAND (stmt, 0);
    
    type = TREE_TYPE (TREE_OPERAND (stmt, 1));
    TREE_OPERAND (stmt, 1) = build (COMPLEX_EXPR, type, r, i);
+   modify_stmt (stmt);
  }
  
  /* Expand complex addition to scalars:
*************** static void
*** 326,332 ****
  expand_complex_comparison (block_stmt_iterator *bsi, tree ar, tree ai,
  			   tree br, tree bi, enum tree_code code)
  {
!   tree cr, ci, cc, stmt, type;
  
    cr = gimplify_build2 (bsi, code, boolean_type_node, ar, br);
    ci = gimplify_build2 (bsi, code, boolean_type_node, ai, bi);
--- 326,332 ----
  expand_complex_comparison (block_stmt_iterator *bsi, tree ar, tree ai,
  			   tree br, tree bi, enum tree_code code)
  {
!   tree cr, ci, cc, stmt, expr, type;
  
    cr = gimplify_build2 (bsi, code, boolean_type_node, ar, br);
    ci = gimplify_build2 (bsi, code, boolean_type_node, ai, bi);
*************** expand_complex_comparison (block_stmt_it
*** 334,350 ****
  			(code == EQ_EXPR ? TRUTH_AND_EXPR : TRUTH_OR_EXPR),
  			boolean_type_node, cr, ci);
  
!   stmt = bsi_stmt (*bsi);
!   modify_stmt (stmt);
  
    switch (TREE_CODE (stmt))
      {
      case RETURN_EXPR:
!       stmt = TREE_OPERAND (stmt, 0);
        /* FALLTHRU */
      case MODIFY_EXPR:
!       type = TREE_TYPE (TREE_OPERAND (stmt, 1));
!       TREE_OPERAND (stmt, 1) = fold_convert (type, cc);
        break;
      case COND_EXPR:
        TREE_OPERAND (stmt, 0) = cc;
--- 334,349 ----
  			(code == EQ_EXPR ? TRUTH_AND_EXPR : TRUTH_OR_EXPR),
  			boolean_type_node, cr, ci);
  
!   stmt = expr = bsi_stmt (*bsi);
  
    switch (TREE_CODE (stmt))
      {
      case RETURN_EXPR:
!       expr = TREE_OPERAND (stmt, 0);
        /* FALLTHRU */
      case MODIFY_EXPR:
!       type = TREE_TYPE (TREE_OPERAND (expr, 1));
!       TREE_OPERAND (expr, 1) = fold_convert (type, cc);
        break;
      case COND_EXPR:
        TREE_OPERAND (stmt, 0) = cc;
*************** expand_complex_comparison (block_stmt_it
*** 352,357 ****
--- 351,358 ----
      default:
        abort ();
      }
+ 
+   modify_stmt (stmt);
  }
  
  /* Process one statement.  If we identify a complex operation, expand it.  */
Index: tree-outof-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-outof-ssa.c,v
retrieving revision 2.13
diff -c -p -r2.13 tree-outof-ssa.c
*** tree-outof-ssa.c	28 Jul 2004 05:13:08 -0000	2.13
--- tree-outof-ssa.c	4 Aug 2004 15:42:13 -0000
*************** rewrite_trees (var_map map, tree *values
*** 1927,1933 ****
  		      && (DEF_FROM_PTR (def_p) == USE_OP (uses, 0)))
  		    remove = 1;
  		}
! 	      if (changed)
  		modify_stmt (stmt);
  	    }
  
--- 1927,1933 ----
  		      && (DEF_FROM_PTR (def_p) == USE_OP (uses, 0)))
  		    remove = 1;
  		}
! 	      if (changed & !remove)
  		modify_stmt (stmt);
  	    }
  
*************** rewrite_vars_out_of_ssa (bitmap vars)
*** 2120,2126 ****
  
  		      /* Queue the statement for insertion.  */
  		      bsi_insert_on_edge (PHI_ARG_EDGE (phi, i), copy);
- 		      modify_stmt (copy);
  		    }
  		}
  	    }
--- 2120,2125 ----
Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-ccp.c,v
retrieving revision 2.29
diff -c -p -r2.29 tree-ssa-ccp.c
*** tree-ssa-ccp.c	30 Jul 2004 22:55:25 -0000	2.29
--- tree-ssa-ccp.c	4 Aug 2004 15:42:14 -0000
*************** substitute_and_fold (void)
*** 427,433 ****
  	    {
  	      bool changed = fold_stmt (bsi_stmt_ptr (i));
  	      stmt = bsi_stmt(i);
- 	      modify_stmt (stmt);
  	      /* If we folded a builtin function, we'll likely
  		 need to rename VDEFs.  */
  	      if (replaced_address || changed)
--- 427,432 ----
*************** substitute_and_fold (void)
*** 436,441 ****
--- 435,442 ----
  		  if (maybe_clean_eh_stmt (stmt))
  		    tree_purge_dead_eh_edges (bb);
  		}
+ 	      else
+ 		modify_stmt (stmt);
  	    }
  
  	  if (dump_file && (dump_flags & TDF_DETAILS))
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
retrieving revision 2.28
diff -c -p -r2.28 tree-ssa-dom.c
*** tree-ssa-dom.c	28 Jul 2004 05:13:08 -0000	2.28
--- tree-ssa-dom.c	4 Aug 2004 15:42:14 -0000
*************** static void record_cond (tree, tree, var
*** 234,247 ****
  static void record_dominating_conditions (tree, varray_type *);
  static void record_const_or_copy (tree, tree, varray_type *);
  static void record_equality (tree, tree, varray_type *);
! static tree update_rhs_and_lookup_avail_expr (tree, tree, varray_type *,
! 					      stmt_ann_t, bool);
  static tree simplify_rhs_and_lookup_avail_expr (struct dom_walk_data *,
! 						tree, stmt_ann_t, int);
  static tree simplify_cond_and_lookup_avail_expr (tree, varray_type *,
  						 stmt_ann_t, int);
! static tree simplify_switch_and_lookup_avail_expr (tree, varray_type *,
! 						   stmt_ann_t, int);
  static tree find_equivalent_equality_comparison (tree);
  static void record_range (tree, basic_block, varray_type *);
  static bool extract_range_from_cond (tree, tree *, tree *, int *);
--- 234,245 ----
  static void record_dominating_conditions (tree, varray_type *);
  static void record_const_or_copy (tree, tree, varray_type *);
  static void record_equality (tree, tree, varray_type *);
! static tree update_rhs_and_lookup_avail_expr (tree, tree, varray_type *, bool);
  static tree simplify_rhs_and_lookup_avail_expr (struct dom_walk_data *,
! 						tree, int);
  static tree simplify_cond_and_lookup_avail_expr (tree, varray_type *,
  						 stmt_ann_t, int);
! static tree simplify_switch_and_lookup_avail_expr (tree, varray_type *, int);
  static tree find_equivalent_equality_comparison (tree);
  static void record_range (tree, basic_block, varray_type *);
  static bool extract_range_from_cond (tree, tree *, tree *, int *);
*************** thread_across_edge (struct dom_walk_data
*** 915,924 ****
  	    cached_lhs = lookup_avail_expr (dummy_cond, NULL, false);
   	  if (!cached_lhs || ! is_gimple_min_invariant (cached_lhs))
  	    {
- 	      stmt_ann_t ann = get_stmt_ann (dummy_cond);
  	      cached_lhs = simplify_cond_and_lookup_avail_expr (dummy_cond,
  								NULL,
! 								ann,
  								false);
  	    }
  	}
--- 913,921 ----
  	    cached_lhs = lookup_avail_expr (dummy_cond, NULL, false);
   	  if (!cached_lhs || ! is_gimple_min_invariant (cached_lhs))
  	    {
  	      cached_lhs = simplify_cond_and_lookup_avail_expr (dummy_cond,
  								NULL,
! 								NULL,
  								false);
  	    }
  	}
*************** record_equality (tree x, tree y, varray_
*** 1903,1911 ****
  
  static tree
  simplify_rhs_and_lookup_avail_expr (struct dom_walk_data *walk_data,
! 				    tree stmt,
! 				    stmt_ann_t ann,
! 				    int insert)
  {
    tree rhs = TREE_OPERAND (stmt, 1);
    enum tree_code rhs_code = TREE_CODE (rhs);
--- 1900,1906 ----
  
  static tree
  simplify_rhs_and_lookup_avail_expr (struct dom_walk_data *walk_data,
! 				    tree stmt, int insert)
  {
    tree rhs = TREE_OPERAND (stmt, 1);
    enum tree_code rhs_code = TREE_CODE (rhs);
*************** simplify_rhs_and_lookup_avail_expr (stru
*** 1938,1944 ****
  	    result = update_rhs_and_lookup_avail_expr (stmt,
  						       rhs_def_operand,
  						       &bd->avail_exprs,
- 						       ann,
  						       insert);
  	}
      }
--- 1933,1938 ----
*************** simplify_rhs_and_lookup_avail_expr (stru
*** 2023,2029 ****
  			  && TREE_CODE (TREE_OPERAND (t, 0)) == SSA_NAME
  			  && is_gimple_val (TREE_OPERAND (t, 1))))
  		    result = update_rhs_and_lookup_avail_expr
! 		      (stmt, t, &bd->avail_exprs, ann, insert);
  		}
  	    }
  	}
--- 2017,2023 ----
  			  && TREE_CODE (TREE_OPERAND (t, 0)) == SSA_NAME
  			  && is_gimple_val (TREE_OPERAND (t, 1))))
  		    result = update_rhs_and_lookup_avail_expr
! 		      (stmt, t, &bd->avail_exprs, insert);
  		}
  	    }
  	}
*************** simplify_rhs_and_lookup_avail_expr (stru
*** 2083,2090 ****
  					  op1, integer_one_node)));
  
  	  result = update_rhs_and_lookup_avail_expr (stmt, t,
! 						     &bd->avail_exprs,
! 						     ann, insert);
  	}
      }
  
--- 2077,2083 ----
  					  op1, integer_one_node)));
  
  	  result = update_rhs_and_lookup_avail_expr (stmt, t,
! 						     &bd->avail_exprs, insert);
  	}
      }
  
*************** simplify_rhs_and_lookup_avail_expr (stru
*** 2155,2162 ****
  	    t = op;
  
  	  result = update_rhs_and_lookup_avail_expr (stmt, t,
! 						     &bd->avail_exprs,
! 						     ann, insert);
  	}
      }
  
--- 2148,2154 ----
  	    t = op;
  
  	  result = update_rhs_and_lookup_avail_expr (stmt, t,
! 						     &bd->avail_exprs, insert);
  	}
      }
  
*************** simplify_rhs_and_lookup_avail_expr (stru
*** 2168,2175 ****
  
        if (t)
          result = update_rhs_and_lookup_avail_expr (stmt, t,
! 						   &bd->avail_exprs,
! 						   ann, insert);
      }
  
    return result;
--- 2160,2166 ----
  
        if (t)
          result = update_rhs_and_lookup_avail_expr (stmt, t,
! 						   &bd->avail_exprs, insert);
      }
  
    return result;
*************** simplify_cond_and_lookup_avail_expr (tre
*** 2276,2282 ****
  		  /* Update the statement to use the new equivalent
  		     condition.  */
  		  COND_EXPR_COND (stmt) = new_cond;
! 		  ann->modified = 1;
  
  		  /* Lookup the condition and return its known value if it
  		     exists.  */
--- 2267,2277 ----
  		  /* Update the statement to use the new equivalent
  		     condition.  */
  		  COND_EXPR_COND (stmt) = new_cond;
! 
! 		  /* If this is not a real stmt, ann will be NULL and we
! 		     avoid processing the operands.  */
! 		  if (ann)
! 		    modify_stmt (stmt);
  
  		  /* Lookup the condition and return its known value if it
  		     exists.  */
*************** simplify_cond_and_lookup_avail_expr (tre
*** 2472,2478 ****
  static tree
  simplify_switch_and_lookup_avail_expr (tree stmt,
  				       varray_type *block_avail_exprs_p,
- 				       stmt_ann_t ann,
  				       int insert)
  {
    tree cond = SWITCH_COND (stmt);
--- 2467,2472 ----
*************** simplify_switch_and_lookup_avail_expr (t
*** 2518,2524 ****
  	      if (!fail)
  		{
  		  SWITCH_COND (stmt) = def;
! 		  ann->modified = 1;
  
  		  return lookup_avail_expr (stmt, block_avail_exprs_p, insert);
  		}
--- 2512,2518 ----
  	      if (!fail)
  		{
  		  SWITCH_COND (stmt) = def;
! 		  modify_stmt (stmt);
  
  		  return lookup_avail_expr (stmt, block_avail_exprs_p, insert);
  		}
*************** eliminate_redundant_computations (struct
*** 2679,2685 ****
    if (! cached_lhs && TREE_CODE (stmt) == MODIFY_EXPR)
      cached_lhs = simplify_rhs_and_lookup_avail_expr (walk_data,
  						     stmt,
- 						     ann,
  						     insert);
    /* Similarly if this is a COND_EXPR and we did not find its
       expression in the hash table, simplify the condition and
--- 2673,2678 ----
*************** eliminate_redundant_computations (struct
*** 2693,2699 ****
    else if (!cached_lhs && TREE_CODE (stmt) == SWITCH_EXPR)
      cached_lhs = simplify_switch_and_lookup_avail_expr (stmt,
  						        &bd->avail_exprs,
- 						        ann,
  						        insert);
  
    opt_stats.num_exprs_considered++;
--- 2686,2691 ----
*************** eliminate_redundant_computations (struct
*** 2740,2746 ****
  	retval = true;
  
        propagate_tree_value (expr_p, cached_lhs);
!       ann->modified = 1;
      }
    return retval;
  }
--- 2732,2738 ----
  	retval = true;
  
        propagate_tree_value (expr_p, cached_lhs);
!       modify_stmt (stmt);
      }
    return retval;
  }
*************** record_equivalences_from_stmt (tree stmt
*** 2847,2853 ****
      {
        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
--- 2839,2844 ----
*************** record_equivalences_from_stmt (tree stmt
*** 2917,2923 ****
     CONST_AND_COPIES.  */
  
  static bool
! cprop_operand (stmt_ann_t ann, use_operand_p op_p, varray_type const_and_copies)
  {
    bool may_have_exposed_new_symbols = false;
    tree val;
--- 2879,2885 ----
     CONST_AND_COPIES.  */
  
  static bool
! cprop_operand (tree stmt, use_operand_p op_p, varray_type const_and_copies)
  {
    bool may_have_exposed_new_symbols = false;
    tree val;
*************** cprop_operand (stmt_ann_t ann, use_opera
*** 2996,3002 ****
        /* And note that we modified this statement.  This is now
  	 safe, even if we changed virtual operands since we will
  	 rescan the statement and rewrite its operands again.  */
!       ann->modified = 1;
      }
    return may_have_exposed_new_symbols;
  }
--- 2958,2964 ----
        /* And note that we modified this statement.  This is now
  	 safe, even if we changed virtual operands since we will
  	 rescan the statement and rewrite its operands again.  */
!       modify_stmt (stmt);
      }
    return may_have_exposed_new_symbols;
  }
*************** cprop_into_stmt (tree stmt, varray_type 
*** 3024,3030 ****
        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);
--- 2986,2992 ----
        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);
*************** cprop_into_stmt (tree stmt, varray_type 
*** 3034,3040 ****
        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);
--- 2996,3002 ----
        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);
*************** cprop_into_stmt (tree stmt, varray_type 
*** 3044,3050 ****
        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;
  }
--- 3006,3012 ----
        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;
  }
*************** optimize_stmt (struct dom_walk_data *wal
*** 3211,3217 ****
  static tree
  update_rhs_and_lookup_avail_expr (tree stmt, tree new_rhs, 
  				  varray_type *block_avail_exprs_p,
- 				  stmt_ann_t ann,
  				  bool insert)
  {
    tree cached_lhs = NULL;
--- 3173,3178 ----
*************** update_rhs_and_lookup_avail_expr (tree s
*** 3257,3263 ****
  
    /* And make sure we record the fact that we modified this
       statement.  */
!   ann->modified = 1;
  
    return cached_lhs;
  }
--- 3218,3224 ----
  
    /* And make sure we record the fact that we modified this
       statement.  */
!   modify_stmt (stmt);
  
    return cached_lhs;
  }
Index: tree-ssa-loop-im.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-im.c,v
retrieving revision 2.3
diff -c -p -r2.3 tree-ssa-loop-im.c
*** tree-ssa-loop-im.c	29 Jul 2004 17:49:31 -0000	2.3
--- tree-ssa-loop-im.c	4 Aug 2004 15:42:15 -0000
*************** schedule_sm (struct loop *loop, edge *ex
*** 1000,1007 ****
  
    /* Emit the load & stores.  */
    load = build (MODIFY_EXPR, void_type_node, tmp_var, ref);
!   modify_stmt (load);
!   stmt_ann (load)->common.aux = xcalloc (1, sizeof (struct lim_aux_data));
    LIM_DATA (load)->max_loop = loop;
    LIM_DATA (load)->tgt_loop = loop;
  
--- 1000,1006 ----
  
    /* Emit the load & stores.  */
    load = build (MODIFY_EXPR, void_type_node, tmp_var, ref);
!   get_stmt_ann (load)->common.aux = xcalloc (1, sizeof (struct lim_aux_data));
    LIM_DATA (load)->max_loop = loop;
    LIM_DATA (load)->tgt_loop = loop;
  
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa.c,v
retrieving revision 2.26
diff -c -p -r2.26 tree-ssa.c
*** tree-ssa.c	29 Jul 2004 20:16:26 -0000	2.26
--- tree-ssa.c	4 Aug 2004 15:42:15 -0000
*************** propagate_into_addr (tree stmt, tree var
*** 925,931 ****
        || TREE_OPERAND (*x, 0) != var)
      return;
  
-   modify_stmt (stmt);
    if (TREE_TYPE (*x) == TREE_TYPE (addr_var))
      {
        *x = addr_var;
--- 925,930 ----
*************** propagate_into_addr (tree stmt, tree var
*** 933,938 ****
--- 932,938 ----
        return;
      }
  
+ 
    /* Frontends sometimes produce expressions like *&a instead of a[0].
       Create a temporary variable to handle this case.  */
    ass_stmt = build2 (MODIFY_EXPR, void_type_node, NULL_TREE, repl);




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]