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: Possible patch for tree-optimization/13000


On Thu, Jan 20, 2005 at 09:50:57PM -0500, Ian Lance Taylor wrote:
> @@ -6764,6 +6765,16 @@ c_finish_bc_stmt (tree *label_p, bool is
>  {
>    tree label = *label_p;
>  
> +  /* In switch statements break is sometimes stylistically used after
> +     a return statement.  This can lead to spurious warnings about
> +     control reaching the end of a non-void function when it is
> +     inlined.  Note that we are calling block_may_fallthru with
> +     language specific tree nodes; this works because
> +     block_may_fallthru returns true when given something it does not
> +     understand.  */
> +  if (! block_may_fallthru (cur_stmt_list))
> +    return NULL_TREE;
> +
>    if (!label)
>      *label_p = label = create_artificial_label ();
>    else if (TREE_CODE (label) != LABEL_DECL)

Also, you've failed to issue the error needed for 

void foo()
{
  return;
  break;
}


r~


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