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]

Re: [PATCH, middle-end] Switch initializations conversion


Hi,

On Tue, Jul 01, 2008 at 11:02:48AM +0200, Martin Jambor wrote:
> I have eventually committed the following as revision 137313.  The only
> difference  from what  I  posted  yesterday is  a  minor difference  in
> formatting of the affected option list in documentation (invoke.texi).
> 

Bernhard Fischer spotted a supid mistake in the documentation and a
few errors in comments and two in coding style.  The credit for the
following patch therefore should go to him (he in fact sent me the
main part of it as a patch).

I have cehcked this in under the obvious rule as revision 137347 after
bootstrapping and regression testing on x86_64-suse-linux.


2008-07-02  Martin Jambor  <mjambor@suse.cz>

	* tree-switch-conversion.c: Corrected various comments and
	whitespace issues
	(build_constructors): Fixed minor formatting mistakes.

	* invoke.texi (Optimize Options): Corrected the
	switch-conversion-max-branch-ratio parameter.

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 137322)
+++ gcc/doc/invoke.texi	(working copy)
@@ -7352,7 +7352,7 @@ set this value to 0 to disable canonical
 
 @item switch-conversion-max-branch-ratio
 Switch initialization conversion will refuse to create arrays that are
-bigger than @option{cswtch-max-branch-ratio} times the number of
+bigger than @option{switch-conversion-max-branch-ratio} times the number of
 branches in the switch.
 
 @item max-partial-antic-length
Index: gcc/tree-switch-conversion.c
===================================================================
--- gcc/tree-switch-conversion.c	(revision 137322)
+++ gcc/tree-switch-conversion.c	(working copy)
@@ -107,7 +107,7 @@ struct switch_conv_info
      cases.  */
   tree range_min;
 
-  /* The difference of between the above two numbers, i.e. The size of the array
+  /* The difference between the above two numbers, i.e. The size of the array
      that would have to be created by the transformation.  */
   tree range_size;
 
@@ -121,7 +121,7 @@ struct switch_conv_info
   /* Number of phi nodes in the final bb (that we'll be replacing).  */
   int phi_count;
 
-  /* Array of default values, n the same order as phi nodes.  */
+  /* Array of default values, in the same order as phi nodes.  */
   tree *default_values;
 
   /* Constructors of new static arrays.  */
@@ -144,7 +144,8 @@ struct switch_conv_info
   /* Combined count of all other (non-default) edges in the replaced switch.  */
   gcov_type other_count;
 
-  /* The last load statement that loads a temporary from a new static array.  */
+  /* The first load statement that loads a temporary from a new static array.
+   */
   tree arr_ref_first;
 
   /* The last load statement that loads a temporary from a new static array.  */
@@ -299,7 +300,7 @@ check_final_bb (void)
 	      && !is_gimple_min_invariant (PHI_ARG_ELT (phi, i).def))
 	    {
 	      info.reason = "   Non-invariant value from a case\n";
-	      return false; 		/* non invariant argument */
+	      return false; /* non invariant argument */
 	    }
 	}
     }
@@ -409,13 +410,13 @@ build_constructors (tree swtch)
 
 	  pos = int_const_binop (PLUS_EXPR, pos, integer_one_node, 0);
 	}
-      gcc_assert (tree_int_cst_equal (pos, CASE_LOW(cs)));
+      gcc_assert (tree_int_cst_equal (pos, CASE_LOW (cs)));
 
       j = 0;
       if (CASE_HIGH (cs))
 	high = CASE_HIGH (cs);
       else
-	high = CASE_LOW(cs);
+	high = CASE_LOW (cs);
       for (phi = phi_nodes (info.final_bb); phi; phi = PHI_CHAIN (phi))
 	{
 	  tree val = PHI_ARG_DEF_FROM_EDGE (phi, e);
@@ -793,7 +794,7 @@ process_switch (tree swtch)
   build_constructors (swtch);
 
   build_arrays (swtch); /* Build the static arrays and assignments.   */
-  gen_inbound_check (swtch); 	/* Build the bounds check.  */
+  gen_inbound_check (swtch);	/* Build the bounds check.  */
 
   /* Cleanup:  */
   free_temp_arrays ();
@@ -862,12 +863,12 @@ struct gimple_opt_pass pass_convert_swit
  {
   GIMPLE_PASS,
   "switchconv",				/* name */
-  switchconv_gate,        		/* gate */
+  switchconv_gate,			/* gate */
   do_switchconv,			/* execute */
   NULL,					/* sub */
   NULL,					/* next */
   0,					/* static_pass_number */
-  0,			        	/* tv_id */
+  0,					/* tv_id */
   PROP_cfg | PROP_ssa,	                /* properties_required */
   0,					/* properties_provided */
   0,					/* properties_destroyed */


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