[PATCH] tree-vect-transform.c: remove some "set but not used" variables

d binderman dcb314@hotmail.com
Sun Sep 28 16:36:00 GMT 2008




I just tried to bootstrap the most recent snapshot of gcc version
4.4, dated 20080926, with the Intel C compiler.

The Intel compiler said

../../src/gcc-4.4-20080926/gcc/tree-vect-transform.c(2366): warning #593: variable "bytesize" was set but never used
../../src/gcc-4.4-20080926/gcc/tree-vect-transform.c(2376): warning #593: variable "use_stmt" was set but never used
../../src/gcc-4.4-20080926/gcc/tree-vect-transform.c(3550): warning #593: variable "expr" was set but never used
../../src/gcc-4.4-20080926/gcc/tree-vect-transform.c(4027): warning #593: variable "shift_p" was set but never used
../../src/gcc-4.4-20080926/gcc/tree-vect-transform.c(5041): warning #593: variable "scalar_dest" was set but never used
../../src/gcc-4.4-20080926/gcc/tree-vect-transform.c(5146): warning #593: variable "first_stmt_vinfo" was set but never used
../../src/gcc-4.4-20080926/gcc/tree-vect-transform.c(6013): warning #593: variable "group_size" was set but never used
../../src/gcc-4.4-20080926/gcc/tree-vect-transform.c(6013): warning #593: variable "dr_chain_size" was set but never used
../../src/gcc-4.4-20080926/gcc/tree-vect-transform.c(8058): warning #593: variable "nloop" was set but never used

Here is a ChangeLog entry

2009-09-28  David Binderman 

        * Remove some "set but not used" variables from gcc/tree-vect-transform.c

Here is a patch to shut up the compiler. It seems to bootstrap ok.

--- gcc/tree-vect-transform.c.sav	2008-09-28 09:04:53.000000000 +0100
+++ gcc/tree-vect-transform.c	2008-09-28 09:09:30.000000000 +0100
@@ -2363,7 +2363,7 @@
   gimple epilog_stmt = NULL;
   tree new_scalar_dest, new_dest;
   gimple exit_phi;
-  tree bitsize, bitpos, bytesize; 
+  tree bitsize, bitpos; 
   enum tree_code code = gimple_assign_rhs_code (stmt);
   tree adjustment_def;
   tree vec_initial_def, def;
@@ -2512,7 +2512,7 @@
   scalar_type = TREE_TYPE (scalar_dest);
   new_scalar_dest = vect_create_destination_var (scalar_dest, NULL);
   bitsize = TYPE_SIZE (scalar_type);
-  bytesize = TYPE_SIZE_UNIT (scalar_type);
+  TYPE_SIZE_UNIT (scalar_type);
 
 
   /* In case this is a reduction in an inner-loop while vectorizing an outer
@@ -3547,7 +3547,6 @@
   int nunits_out;
   tree vectype_out, vectype_in;
   int ncopies, j;
-  tree expr;
   tree rhs_type, lhs_type;
   tree builtin_decl;
   enum { NARROW, NONE, WIDEN } modifier;
@@ -3771,7 +3770,7 @@
 	    }
 
 	  /* Arguments are ready. Create the new vector stmt.  */
-	  expr = build2 (code1, vectype_out, vec_oprnd0, vec_oprnd1);
+	  build2 (code1, vectype_out, vec_oprnd0, vec_oprnd1);
 	  new_stmt = gimple_build_assign_with_ops (code1, vec_dest, vec_oprnd0,
 						   vec_oprnd1);
 	  new_temp = make_ssa_name (vec_dest, new_stmt);
@@ -4024,7 +4023,6 @@
   VEC(tree,heap) *vec_oprnds0 = NULL, *vec_oprnds1 = NULL;
   tree vop0, vop1;
   unsigned int k;
-  bool shift_p = false;
   bool scalar_shift_arg = false;
 
   /* Multiple types in SLP are handled by creating the appropriate number of
@@ -4099,8 +4097,6 @@
   if (code == LSHIFT_EXPR || code == RSHIFT_EXPR || code == LROTATE_EXPR
       || code == RROTATE_EXPR)
     {
-      shift_p = true;
-
       /* vector shifted by vector */
       if (dt[1] == vect_loop_def)
 	{
@@ -5038,12 +5034,11 @@
   tree perm_dest, vect1, vect2, high, low;
   gimple perm_stmt;
   tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt));
-  tree scalar_dest;
   int i;
   unsigned int j;
   enum tree_code high_code, low_code;
   
-  scalar_dest = gimple_assign_lhs (stmt);
+  gimple_assign_lhs (stmt);
 
   /* Check that the operation is supported.  */
   if (!vect_strided_store_supported (vectype))
@@ -5143,7 +5138,6 @@
   bool inv_p;
   VEC(tree,heap) *vec_oprnds = NULL;
   bool slp = (slp_node != NULL);
-  stmt_vec_info first_stmt_vinfo;
   unsigned int vec_num;
 
   /* Multiple types in SLP are handled by creating the appropriate number of
@@ -5290,7 +5284,6 @@
       first_stmt = stmt;
       first_dr = dr;
       group_size = vec_num = 1;
-      first_stmt_vinfo = stmt_info;
     }
   
   if (vect_print_dump_info (REPORT_DETAILS))
@@ -6010,7 +6003,7 @@
   tree t = NULL_TREE, mask_vec, mask, perm_dest;
   gimple perm_stmt = NULL;
   stmt_vec_info next_stmt_info;
-  int i, group_size, stride, dr_chain_size;
+  int i, stride;
   tree first_vec, second_vec, data_ref;
   tree sym;
   ssa_op_iter iter;
@@ -6023,9 +6016,9 @@
   mask_vec = build_vector (mask_type, t);
   mask = vect_init_vector (stmt, mask_vec, mask_type, NULL);
 
-  group_size = VEC_length (gimple, SLP_TREE_SCALAR_STMTS (node));
+  VEC_length (gimple, SLP_TREE_SCALAR_STMTS (node));
   stride = SLP_TREE_NUMBER_OF_VEC_STMTS (node) / ncopies;
-  dr_chain_size = VEC_length (tree, dr_chain); 
+  VEC_length (tree, dr_chain); 
 
   /* Initialize the vect stmts of NODE to properly insert the generated 
      stmts later.  */
@@ -8055,7 +8048,6 @@
 vect_loop_versioning (loop_vec_info loop_vinfo)
 {
   struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
-  struct loop *nloop;
   tree cond_expr = NULL_TREE;
   gimple_seq cond_expr_stmt_list = NULL;
   basic_block condition_bb;
@@ -8099,7 +8091,7 @@
   gimple_seq_add_seq (&cond_expr_stmt_list, gimplify_stmt_list);
 
   initialize_original_copy_tables ();
-  nloop = loop_version (loop, cond_expr, &condition_bb,
+  loop_version (loop, cond_expr, &condition_bb,
 			prob, prob, REG_BR_PROB_BASE - prob, true);
   free_original_copy_tables();
 

Regards

David Binderman
_________________________________________________________________
Make a mini you and download it into Windows Live Messenger
http://clk.atdmt.com/UKM/go/111354029/direct/01/



More information about the Gcc-patches mailing list