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: Fix the tree part of the mainline breakage


On Thu, 2004-05-27 at 15:29, Steven Bosscher wrote:

> 	* gimplify.c (sort_case_labels): New.  Split out from...
> 	(gimplify_switch_expr): ...here.  Use it.
> 	* tree-eh.c (lower_try_finally_switch): Sort the labels of
> 	the SWITCH_EXPR created here before leaving the function.
> 	* tree.c (sort_case_labels): Add prototype.
>
Looks fine.  But...


> +   size_t len = TREE_VEC_LENGTH (label_vec);
> +   tree default_case = TREE_VEC_ELT (label_vec, len - 1);
> + 
> +   if (CASE_LOW (default_case))
> +     {
> +       size_t i;
> + 
> +       /* The last label in the vector should be the default case
> +          but it is not.  */
> +       for (i = 0; i < len; ++i)
> + 	{
> + 	  tree t = TREE_VEC_ELT (label_vec, i);
> + 	  if (!CASE_LOW (t))
> + 	    {
> + 	      default_case = t;
> + 	      TREE_VEC_ELT (label_vec, i) = TREE_VEC_ELT (label_vec, len - 1);
> + 	      TREE_VEC_ELT (label_vec, len - 1) = default_case;
> + 	      break;
> + 	    }
> + 	}
> +     }
> + 
Why didn't you remove this chunk out of gimplify_switch_expr?  It seems
that we are now doing this check twice.


Diego.


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