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]

convert some vectors from gc to heap


Hi,
I've installed this patch, which addresses one of the FIXME's I inserted on
the VEC API rewrite.  The vectors used by lambda-loop can all be heap
allocated.

booted & tested on i686-pc-linux-gnu.

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2005-04-22  Nathan Sidwell  <nathan@codesourcery.com>

	* lambda-code.c: Define VEC(int,heap), VEC(lambda_loop,heap).
	(gcc_tree_to_linear_expression): Convert to heap allocated
	vectors.
	(gcc_loop_to_lambda_loop, gcc_loopnest_to_lambda_loopnest,
	lbv_to_gcc_expression, lle_to_gcc_expression,
	lambda_loopnest_to_gcc_loopnest, can_convert_to_perfect_nest, 
	perfect_nestify): Likewise.
	lambda.h (gcc_loopnest_to_lambda_loopnest,
	lambda_loopnest_to_gcc_loopnest): Likewise.
	tree-loop-linear.c (linear_transform_loops): Likewise.

Index: lambda-code.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/lambda-code.c,v
retrieving revision 2.36
diff -c -3 -p -r2.36 lambda-code.c
*** lambda-code.c	21 Apr 2005 15:47:28 -0000	2.36
--- lambda-code.c	22 Apr 2005 10:47:59 -0000
***************
*** 115,130 ****
   Fourier-Motzkin elimination is used to compute the bounds of the base space
   of the lattice.  */
  
- /* FIXME: I'm sure the vectors used here could be heap allocated.
-    There certainly should be explicit VEC_frees, either way.  (nathan
-    2005/04/14) */
- 
  DEF_VEC_P(int);
! DEF_VEC_ALLOC_P(int,gc);
  
  static bool perfect_nestify (struct loops *, 
! 			     struct loop *, VEC(tree,gc) *, 
! 			     VEC(tree,gc) *, VEC(int,gc) *, VEC(tree,gc) *);
  /* Lattice stuff that is internal to the code generation algorithm.  */
  
  typedef struct
--- 115,127 ----
   Fourier-Motzkin elimination is used to compute the bounds of the base space
   of the lattice.  */
  
  DEF_VEC_P(int);
! DEF_VEC_ALLOC_P(int,heap);
  
  static bool perfect_nestify (struct loops *, 
! 			     struct loop *, VEC(tree,heap) *, 
! 			     VEC(tree,heap) *, VEC(int,heap) *,
! 			     VEC(tree,heap) *);
  /* Lattice stuff that is internal to the code generation algorithm.  */
  
  typedef struct
*************** lambda_loopnest_transform (lambda_loopne
*** 1156,1163 ****
  
  static lambda_linear_expression
  gcc_tree_to_linear_expression (int depth, tree expr,
! 			       VEC(tree,gc) *outerinductionvars,
! 			       VEC(tree,gc) *invariants, int extra)
  {
    lambda_linear_expression lle = NULL;
    switch (TREE_CODE (expr))
--- 1153,1160 ----
  
  static lambda_linear_expression
  gcc_tree_to_linear_expression (int depth, tree expr,
! 			       VEC(tree,heap) *outerinductionvars,
! 			       VEC(tree,heap) *invariants, int extra)
  {
    lambda_linear_expression lle = NULL;
    switch (TREE_CODE (expr))
*************** invariant_in_loop_and_outer_loops (struc
*** 1252,1263 ****
  
  static lambda_loop
  gcc_loop_to_lambda_loop (struct loop *loop, int depth,
! 			 VEC(tree,gc) ** invariants,
  			 tree * ourinductionvar,
! 			 VEC(tree,gc) * outerinductionvars,
! 			 VEC(tree,gc) ** lboundvars,
! 			 VEC(tree,gc) ** uboundvars,
! 			 VEC(int,gc) ** steps)
  {
    tree phi;
    tree exit_cond;
--- 1249,1260 ----
  
  static lambda_loop
  gcc_loop_to_lambda_loop (struct loop *loop, int depth,
! 			 VEC(tree,heap) ** invariants,
  			 tree * ourinductionvar,
! 			 VEC(tree,heap) * outerinductionvars,
! 			 VEC(tree,heap) ** lboundvars,
! 			 VEC(tree,heap) ** uboundvars,
! 			 VEC(int,heap) ** steps)
  {
    tree phi;
    tree exit_cond;
*************** gcc_loop_to_lambda_loop (struct loop *lo
*** 1405,1416 ****
        return NULL;
      }
    /* One part of the test may be a loop invariant tree.  */
    if (TREE_CODE (TREE_OPERAND (test, 1)) == SSA_NAME
        && invariant_in_loop_and_outer_loops (loop, TREE_OPERAND (test, 1)))
!     VEC_safe_push (tree, gc, *invariants, TREE_OPERAND (test, 1));
    else if (TREE_CODE (TREE_OPERAND (test, 0)) == SSA_NAME
  	   && invariant_in_loop_and_outer_loops (loop, TREE_OPERAND (test, 0)))
!     VEC_safe_push (tree, gc, *invariants, TREE_OPERAND (test, 0));
    
    /* The non-induction variable part of the test is the upper bound variable.
     */
--- 1402,1414 ----
        return NULL;
      }
    /* One part of the test may be a loop invariant tree.  */
+   VEC_reserve (tree, heap, *invariants, 1);
    if (TREE_CODE (TREE_OPERAND (test, 1)) == SSA_NAME
        && invariant_in_loop_and_outer_loops (loop, TREE_OPERAND (test, 1)))
!     VEC_quick_push (tree, *invariants, TREE_OPERAND (test, 1));
    else if (TREE_CODE (TREE_OPERAND (test, 0)) == SSA_NAME
  	   && invariant_in_loop_and_outer_loops (loop, TREE_OPERAND (test, 0)))
!     VEC_quick_push (tree, *invariants, TREE_OPERAND (test, 0));
    
    /* The non-induction variable part of the test is the upper bound variable.
     */
*************** gcc_loop_to_lambda_loop (struct loop *lo
*** 1442,1450 ****
  					  *invariants, extra);
    uboundresult = build (PLUS_EXPR, TREE_TYPE (uboundvar), uboundvar,
  			build_int_cst (TREE_TYPE (uboundvar), extra));
!   VEC_safe_push (tree, gc, *uboundvars, uboundresult);
!   VEC_safe_push (tree, gc, *lboundvars, lboundvar);
!   VEC_safe_push (int, gc, *steps, stepint);
    if (!ubound)
      {
        if (dump_file && (dump_flags & TDF_DETAILS))
--- 1440,1448 ----
  					  *invariants, extra);
    uboundresult = build (PLUS_EXPR, TREE_TYPE (uboundvar), uboundvar,
  			build_int_cst (TREE_TYPE (uboundvar), extra));
!   VEC_safe_push (tree, heap, *uboundvars, uboundresult);
!   VEC_safe_push (tree, heap, *lboundvars, lboundvar);
!   VEC_safe_push (int, heap, *steps, stepint);
    if (!ubound)
      {
        if (dump_file && (dump_flags & TDF_DETAILS))
*************** find_induction_var_from_exit_cond (struc
*** 1493,1499 ****
  }
  
  DEF_VEC_P(lambda_loop);
! DEF_VEC_ALLOC_P(lambda_loop,gc);
  
  /* Generate a lambda loopnest from a gcc loopnest LOOP_NEST.
     Return the new loop nest.  
--- 1491,1497 ----
  }
  
  DEF_VEC_P(lambda_loop);
! DEF_VEC_ALLOC_P(lambda_loop,heap);
  
  /* Generate a lambda loopnest from a gcc loopnest LOOP_NEST.
     Return the new loop nest.  
*************** DEF_VEC_ALLOC_P(lambda_loop,gc);
*** 1505,1522 ****
  lambda_loopnest
  gcc_loopnest_to_lambda_loopnest (struct loops *currloops,
  				 struct loop * loop_nest,
! 				 VEC(tree,gc) **inductionvars,
! 				 VEC(tree,gc) **invariants,
  				 bool need_perfect_nest)
  {
!   lambda_loopnest ret;
    struct loop *temp;
    int depth = 0;
    size_t i;
!   VEC(lambda_loop,gc) *loops = NULL;
!   VEC(tree,gc) *uboundvars = NULL;
!   VEC(tree,gc) *lboundvars  = NULL;
!   VEC(int,gc) *steps = NULL;
    lambda_loop newloop;
    tree inductionvar = NULL;
    
--- 1503,1520 ----
  lambda_loopnest
  gcc_loopnest_to_lambda_loopnest (struct loops *currloops,
  				 struct loop * loop_nest,
! 				 VEC(tree,heap) **inductionvars,
! 				 VEC(tree,heap) **invariants,
  				 bool need_perfect_nest)
  {
!   lambda_loopnest ret = NULL;
    struct loop *temp;
    int depth = 0;
    size_t i;
!   VEC(lambda_loop,heap) *loops = NULL;
!   VEC(tree,heap) *uboundvars = NULL;
!   VEC(tree,heap) *lboundvars  = NULL;
!   VEC(int,heap) *steps = NULL;
    lambda_loop newloop;
    tree inductionvar = NULL;
    
*************** gcc_loopnest_to_lambda_loopnest (struct 
*** 1530,1537 ****
  					 &steps);
        if (!newloop)
  	return NULL;
!       VEC_safe_push (tree, gc, *inductionvars, inductionvar);
!       VEC_safe_push (lambda_loop, gc, loops, newloop);
        temp = temp->inner;
      }
    if (need_perfect_nest)
--- 1528,1535 ----
  					 &steps);
        if (!newloop)
  	return NULL;
!       VEC_safe_push (tree, heap, *inductionvars, inductionvar);
!       VEC_safe_push (lambda_loop, heap, loops, newloop);
        temp = temp->inner;
      }
    if (need_perfect_nest)
*************** gcc_loopnest_to_lambda_loopnest (struct 
*** 1540,1562 ****
  			    lboundvars, uboundvars, steps, *inductionvars))
  	{
  	  if (dump_file)
! 	    fprintf (dump_file, "Not a perfect loop nest and couldn't convert to one.\n");    
! 	  return NULL;
  	}
        else if (dump_file)
! 	fprintf (dump_file, "Successfully converted loop nest to perfect loop nest.\n");
! 
!       
      }
    ret = lambda_loopnest_new (depth, 2 * depth);
    for (i = 0; VEC_iterate (lambda_loop, loops, i, newloop); i++)
      LN_LOOPS (ret)[i] = newloop;
! 
    return ret;
- 
  }
  
- 
  /* Convert a lambda body vector LBV to a gcc tree, and return the new tree. 
     STMTS_TO_INSERT is a pointer to a tree where the statements we need to be
     inserted for us are stored.  INDUCTION_VARS is the array of induction
--- 1538,1563 ----
  			    lboundvars, uboundvars, steps, *inductionvars))
  	{
  	  if (dump_file)
! 	    fprintf (dump_file,
! 		     "Not a perfect loop nest and couldn't convert to one.\n");    
! 	  goto fail;
  	}
        else if (dump_file)
! 	fprintf (dump_file,
! 		 "Successfully converted loop nest to perfect loop nest.\n");
      }
    ret = lambda_loopnest_new (depth, 2 * depth);
    for (i = 0; VEC_iterate (lambda_loop, loops, i, newloop); i++)
      LN_LOOPS (ret)[i] = newloop;
!  fail:
!   VEC_free (lambda_loop, heap, loops);
!   VEC_free (tree, heap, uboundvars);
!   VEC_free (tree, heap, lboundvars);
!   VEC_free (int, heap, steps);
!   
    return ret;
  }
  
  /* Convert a lambda body vector LBV to a gcc tree, and return the new tree. 
     STMTS_TO_INSERT is a pointer to a tree where the statements we need to be
     inserted for us are stored.  INDUCTION_VARS is the array of induction
*************** gcc_loopnest_to_lambda_loopnest (struct 
*** 1565,1572 ****
  
  static tree
  lbv_to_gcc_expression (lambda_body_vector lbv, 
! 		       tree type, VEC(tree,gc) *induction_vars, 
! 		       tree * stmts_to_insert)
  {
    tree stmts, stmt, resvar, name;
    tree iv;
--- 1566,1573 ----
  
  static tree
  lbv_to_gcc_expression (lambda_body_vector lbv, 
! 		       tree type, VEC(tree,heap) *induction_vars, 
! 		       tree *stmts_to_insert)
  {
    tree stmts, stmt, resvar, name;
    tree iv;
*************** static tree
*** 1648,1663 ****
  lle_to_gcc_expression (lambda_linear_expression lle,
  		       lambda_linear_expression offset,
  		       tree type,
! 		       VEC(tree,gc) *induction_vars,
! 		       VEC(tree,gc) *invariants,
! 		       enum tree_code wrap, tree * stmts_to_insert)
  {
    tree stmts, stmt, resvar, name;
    size_t i;
    tree_stmt_iterator tsi;
    tree iv, invar;
!   VEC(tree,gc) *results = NULL;
  
    name = NULL_TREE;
    /* Create a statement list and a linear expression temporary.  */
    stmts = alloc_stmt_list ();
--- 1649,1665 ----
  lle_to_gcc_expression (lambda_linear_expression lle,
  		       lambda_linear_expression offset,
  		       tree type,
! 		       VEC(tree,heap) *induction_vars,
! 		       VEC(tree,heap) *invariants,
! 		       enum tree_code wrap, tree *stmts_to_insert)
  {
    tree stmts, stmt, resvar, name;
    size_t i;
    tree_stmt_iterator tsi;
    tree iv, invar;
!   VEC(tree,heap) *results = NULL;
  
+   gcc_assert (wrap == MAX_EXPR || wrap == MIN_EXPR);
    name = NULL_TREE;
    /* Create a statement list and a linear expression temporary.  */
    stmts = alloc_stmt_list ();
*************** lle_to_gcc_expression (lambda_linear_exp
*** 1790,1805 ****
        /* Handle any denominator that occurs.  */
        if (LLE_DENOMINATOR (lle) != 1)
  	{
! 	  if (wrap == MAX_EXPR)
! 	    stmt = build (MODIFY_EXPR, void_type_node, resvar,
! 			  build (CEIL_DIV_EXPR, type, name, 
! 				 build_int_cst (type, LLE_DENOMINATOR (lle))));
! 	  else if (wrap == MIN_EXPR)
! 	    stmt = build (MODIFY_EXPR, void_type_node, resvar,
! 			  build (FLOOR_DIV_EXPR, type, name, 
! 				 build_int_cst (type, LLE_DENOMINATOR (lle))));
! 	  else
! 	    gcc_unreachable();
  
  	  /* name = {ceil, floor}(name/denominator) */
  	  name = make_ssa_name (resvar, stmt);
--- 1792,1801 ----
        /* Handle any denominator that occurs.  */
        if (LLE_DENOMINATOR (lle) != 1)
  	{
! 	  stmt = build_int_cst (type, LLE_DENOMINATOR (lle));
! 	  stmt = build (wrap == MAX_EXPR ? CEIL_DIV_EXPR : FLOOR_DIV_EXPR,
! 			type, name, stmt);
! 	  stmt = build (MODIFY_EXPR, void_type_node, resvar, stmt);
  
  	  /* name = {ceil, floor}(name/denominator) */
  	  name = make_ssa_name (resvar, stmt);
*************** lle_to_gcc_expression (lambda_linear_exp
*** 1807,1813 ****
  	  tsi = tsi_last (stmts);
  	  tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
  	}
!       VEC_safe_push (tree, gc, results, name);
      }
  
    /* Again, out of laziness, we don't handle this case yet.  It's not
--- 1803,1809 ----
  	  tsi = tsi_last (stmts);
  	  tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
  	}
!       VEC_safe_push (tree, heap, results, name);
      }
  
    /* Again, out of laziness, we don't handle this case yet.  It's not
*************** lle_to_gcc_expression (lambda_linear_exp
*** 1827,1832 ****
--- 1823,1830 ----
        tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
      }
  
+   VEC_free (tree, heap, results);
+   
    *stmts_to_insert = stmts;
    return name;
  }
*************** lle_to_gcc_expression (lambda_linear_exp
*** 1845,1860 ****
  
  void
  lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
! 				 VEC(tree,gc) *old_ivs,
! 				 VEC(tree,gc) *invariants,
  				 lambda_loopnest new_loopnest,
  				 lambda_trans_matrix transform)
  {
- 
    struct loop *temp;
    size_t i = 0;
    size_t depth = 0;
!   VEC(tree,gc) *new_ivs = NULL;
    tree oldiv;
    
    block_stmt_iterator bsi;
--- 1843,1857 ----
  
  void
  lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
! 				 VEC(tree,heap) *old_ivs,
! 				 VEC(tree,heap) *invariants,
  				 lambda_loopnest new_loopnest,
  				 lambda_trans_matrix transform)
  {
    struct loop *temp;
    size_t i = 0;
    size_t depth = 0;
!   VEC(tree,heap) *new_ivs = NULL;
    tree oldiv;
    
    block_stmt_iterator bsi;
*************** lambda_loopnest_to_gcc_loopnest (struct 
*** 1889,1895 ****
        ivvar = create_tmp_var (type, "lnivtmp");
        add_referenced_tmp_var (ivvar);
  
!       VEC_safe_push (tree, gc, new_ivs, ivvar);
  
        newloop = LN_LOOPS (new_loopnest)[i];
  
--- 1886,1892 ----
        ivvar = create_tmp_var (type, "lnivtmp");
        add_referenced_tmp_var (ivvar);
  
!       VEC_safe_push (tree, heap, new_ivs, ivvar);
  
        newloop = LN_LOOPS (new_loopnest)[i];
  
*************** lambda_loopnest_to_gcc_loopnest (struct 
*** 2015,2023 ****
  	    }
  	}
      }
  }
  
- 
  /* Returns true when the vector V is lexicographically positive, in
     other words, when the first nonzero element is positive.  */
  
--- 2012,2020 ----
  	    }
  	}
      }
+   VEC_free (tree, heap, new_ivs);
  }
  
  /* Returns true when the vector V is lexicographically positive, in
     other words, when the first nonzero element is positive.  */
  
*************** stmt_uses_op (tree stmt, tree op)
*** 2213,2219 ****
  
  static bool
  can_convert_to_perfect_nest (struct loop *loop,
! 			     VEC(tree,gc) *loopivs)
  {
    basic_block *bbs;
    tree exit_condition, phi;
--- 2210,2216 ----
  
  static bool
  can_convert_to_perfect_nest (struct loop *loop,
! 			     VEC(tree,heap) *loopivs)
  {
    basic_block *bbs;
    tree exit_condition, phi;
*************** can_convert_to_perfect_nest (struct loop
*** 2237,2266 ****
  	    { 
  	      size_t j;
  	      tree stmt = bsi_stmt (bsi);
  	      if (stmt == exit_condition
  		  || not_interesting_stmt (stmt)
  		  || stmt_is_bumper_for_loop (loop, stmt))
  		continue;
  	      /* If the statement uses inner loop ivs, we == screwed.  */
! 	      for (j = 1; j < VEC_length (tree, loopivs); j++)
! 		if (stmt_uses_op (stmt, VEC_index (tree, loopivs, j)))
! 		  {
! 		    free (bbs);
! 		    return false;
! 		  }
  	      
  	      /* If the bb of a statement we care about isn't dominated by 
  		 the header of the inner loop, then we are also screwed.  */
  	      if (!dominated_by_p (CDI_DOMINATORS,
  				   bb_for_stmt (stmt), 
  				   loop->inner->header))
! 		{
! 		  free (bbs);
! 		  return false;
! 		}
  	    }
  	}
!     }  
  
    /* We also need to make sure the loop exit only has simple copy phis in it,
       otherwise we don't know how to transform it into a perfect nest right
--- 2234,2259 ----
  	    { 
  	      size_t j;
  	      tree stmt = bsi_stmt (bsi);
+ 	      tree iv;
+ 	      
  	      if (stmt == exit_condition
  		  || not_interesting_stmt (stmt)
  		  || stmt_is_bumper_for_loop (loop, stmt))
  		continue;
  	      /* If the statement uses inner loop ivs, we == screwed.  */
! 	      for (j = 1; VEC_iterate (tree, loopivs, j, iv); j++)
! 		if (stmt_uses_op (stmt, iv))
! 		  goto fail;
  	      
  	      /* If the bb of a statement we care about isn't dominated by 
  		 the header of the inner loop, then we are also screwed.  */
  	      if (!dominated_by_p (CDI_DOMINATORS,
  				   bb_for_stmt (stmt), 
  				   loop->inner->header))
! 		goto fail;
  	    }
  	}
!     }
  
    /* We also need to make sure the loop exit only has simple copy phis in it,
       otherwise we don't know how to transform it into a perfect nest right
*************** can_convert_to_perfect_nest (struct loop
*** 2269,2277 ****
    
    for (phi = phi_nodes (exitdest); phi; phi = PHI_CHAIN (phi))
      if (PHI_NUM_ARGS (phi) != 1)
!       return false;
! 
    return true;
  }
  
  /* Transform the loop nest into a perfect nest, if possible.
--- 2262,2275 ----
    
    for (phi = phi_nodes (exitdest); phi; phi = PHI_CHAIN (phi))
      if (PHI_NUM_ARGS (phi) != 1)
!       goto fail;
!   
!   free (bbs);
    return true;
+   
+  fail:
+   free (bbs);
+   return false;
  }
  
  /* Transform the loop nest into a perfect nest, if possible.
*************** can_convert_to_perfect_nest (struct loop
*** 2313,2322 ****
  static bool
  perfect_nestify (struct loops *loops,
  		 struct loop *loop,
! 		 VEC(tree,gc) *lbounds,
! 		 VEC(tree,gc) *ubounds,
! 		 VEC(int,gc) *steps,
! 		 VEC(tree,gc) *loopivs)
  {
    basic_block *bbs;
    tree exit_condition;
--- 2311,2320 ----
  static bool
  perfect_nestify (struct loops *loops,
  		 struct loop *loop,
! 		 VEC(tree,heap) *lbounds,
! 		 VEC(tree,heap) *ubounds,
! 		 VEC(int,heap) *steps,
! 		 VEC(tree,heap) *loopivs)
  {
    basic_block *bbs;
    tree exit_condition;
*************** perfect_nestify (struct loops *loops,
*** 2331,2337 ****
    tree uboundvar;
    tree stmt;
    tree oldivvar, ivvar, ivvarinced;
!   VEC(tree,gc) *phis = NULL;
  
    if (!can_convert_to_perfect_nest (loop, loopivs))
      return false;
--- 2329,2335 ----
    tree uboundvar;
    tree stmt;
    tree oldivvar, ivvar, ivvarinced;
!   VEC(tree,heap) *phis = NULL;
  
    if (!can_convert_to_perfect_nest (loop, loopivs))
      return false;
*************** perfect_nestify (struct loops *loops,
*** 2345,2351 ****
    /* Push the exit phi nodes that we are moving.  */
    for (phi = phi_nodes (olddest); phi; phi = PHI_CHAIN (phi))
      {
!       VEC_reserve (tree, gc, phis, 2);
        VEC_quick_push (tree, phis, PHI_RESULT (phi));
        VEC_quick_push (tree, phis, PHI_ARG_DEF (phi, 0));
      }
--- 2343,2349 ----
    /* Push the exit phi nodes that we are moving.  */
    for (phi = phi_nodes (olddest); phi; phi = PHI_CHAIN (phi))
      {
!       VEC_reserve (tree, heap, phis, 2);
        VEC_quick_push (tree, phis, PHI_RESULT (phi));
        VEC_quick_push (tree, phis, PHI_ARG_DEF (phi, 0));
      }
*************** perfect_nestify (struct loops *loops,
*** 2368,2375 ****
        phiname = VEC_pop (tree, phis);      
        phi = create_phi_node (phiname, preheaderbb);
        add_phi_arg (phi, def, single_pred_edge (preheaderbb));
!     }       
    flush_pending_stmts (e);
  
    bodybb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
    latchbb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
--- 2366,2374 ----
        phiname = VEC_pop (tree, phis);      
        phi = create_phi_node (phiname, preheaderbb);
        add_phi_arg (phi, def, single_pred_edge (preheaderbb));
!     }
    flush_pending_stmts (e);
+   VEC_free (tree, heap, phis);
  
    bodybb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
    latchbb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
Index: lambda.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/lambda.h,v
retrieving revision 2.10
diff -c -3 -p -r2.10 lambda.h
*** lambda.h	21 Apr 2005 18:05:12 -0000	2.10
--- lambda.h	22 Apr 2005 10:48:00 -0000
*************** lambda_body_vector lambda_body_vector_co
*** 196,208 ****
  void print_lambda_body_vector (FILE *, lambda_body_vector);
  lambda_loopnest gcc_loopnest_to_lambda_loopnest (struct loops *,
  						 struct loop *,
! 						 VEC(tree,gc) **,
! 						 VEC(tree,gc) **,
  						 bool);
! void lambda_loopnest_to_gcc_loopnest (struct loop *, VEC(tree,gc) *,
! 				      VEC(tree,gc) *,
! 				      lambda_loopnest, 
! 				      lambda_trans_matrix);
  
  
  static inline void lambda_vector_negate (lambda_vector, lambda_vector, int);
--- 196,207 ----
  void print_lambda_body_vector (FILE *, lambda_body_vector);
  lambda_loopnest gcc_loopnest_to_lambda_loopnest (struct loops *,
  						 struct loop *,
! 						 VEC(tree,heap) **,
! 						 VEC(tree,heap) **,
  						 bool);
! void lambda_loopnest_to_gcc_loopnest (struct loop *,
! 				      VEC(tree,heap) *, VEC(tree,heap) *,
! 				      lambda_loopnest, lambda_trans_matrix);
  
  
  static inline void lambda_vector_negate (lambda_vector, lambda_vector, int);
Index: tree-loop-linear.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-loop-linear.c,v
retrieving revision 2.12
diff -c -3 -p -r2.12 tree-loop-linear.c
*** tree-loop-linear.c	21 Apr 2005 09:17:25 -0000	2.12
--- tree-loop-linear.c	22 Apr 2005 10:48:00 -0000
*************** void
*** 243,251 ****
  linear_transform_loops (struct loops *loops)
  {
    unsigned int i;
!   VEC(tree,gc) *oldivs = NULL;  /* FIXME:These should really be on the
! 				   heap.  (nathan 2005/04/15)*/
!   VEC(tree,gc) *invariants = NULL;  /* FIXME:Likewise. */
    
    for (i = 1; i < loops->num; i++)
      {
--- 243,250 ----
  linear_transform_loops (struct loops *loops)
  {
    unsigned int i;
!   VEC(tree,heap) *oldivs = NULL;
!   VEC(tree,heap) *invariants = NULL;
    
    for (i = 1; i < loops->num; i++)
      {
*************** linear_transform_loops (struct loops *lo
*** 371,378 ****
        free_dependence_relations (dependence_relations);
        free_data_refs (datarefs);
      }
!   VEC_free (tree, gc, oldivs);
!   VEC_free (tree, gc, invariants);
    scev_reset ();
    update_ssa (TODO_update_ssa);
    rewrite_into_loop_closed_ssa (NULL);
--- 370,377 ----
        free_dependence_relations (dependence_relations);
        free_data_refs (datarefs);
      }
!   VEC_free (tree, heap, oldivs);
!   VEC_free (tree, heap, invariants);
    scev_reset ();
    update_ssa (TODO_update_ssa);
    rewrite_into_loop_closed_ssa (NULL);

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