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] sort and group case labels


On Wed, May 26, 2004 at 12:06:58AM +0200, Steven Bosscher wrote:
> + 		  /* Merge the cases if they jump to the same place,
> + 		     and their ranges are consecutive.  */
> + 		  if (merge_label == base_label
> + 		      && tree_int_cst_equal (CASE_LOW (merge_case),
> + 					     fold (build (PLUS_EXPR, type,
> + 					     		  base_high,
> + 							  integer_one_node)))
> + 		      /* An overflow is not consecutive.  */
> + 		      && tree_int_cst_lt (base_high,
> + 					  fold (build (PLUS_EXPR, type,
> + 						       base_high,
> + 						       integer_one_node))))

Use int_const_binop instead, and use it only once.

> + 	  /* Copy the grouped old case labels into the new label vector,
> + 	     and replace the old label vector in this switch statement.  */
> + 	  new_labels = make_tree_vec (new_size);

Why allocating a new vector rather than compressing the existing?
Can modify TREE_VEC_LENGTH.


r~


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