This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: A few more fallthrus
- From: Richard Biener <rguenther at suse dot de>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Fri, 12 Aug 2016 09:20:36 +0200 (CEST)
- Subject: Re: RFC: A few more fallthrus
- Authentication-results: sourceware.org; auth=none
- References: <20160811144930.GV7007@redhat.com>
On Thu, 11 Aug 2016, Marek Polacek wrote:
> A few more cases where I'm unsure whether the fall through is intended.
> Jason, can you please look at the cp/ part?
> Richi, would you mind looking at the tree-complex.c bit?
> What 'bout the pch.c?
>
> Thanks,
>
> 2016-08-11 Marek Polacek <polacek@redhat.com>
>
> PR c/7652
> gcc/
> * tree-complex.c (expand_complex_division): Likewise.
> gcc/cp/
> * call.c (add_builtin_candidate): Add gcc_fallthrough.
> * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
> * parser.c (cp_parser_skip_to_end_of_statement): Likewise.
> (cp_parser_cache_defarg): Likewise.
> libcpp/
> * pch.c (write_macdef): Add CPP_FALLTHRU.
>
> --- gcc/gcc/cp/call.c
> +++ gcc/gcc/cp/call.c
> @@ -2542,6 +2544,8 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
> type2 = ptrdiff_type_node;
> break;
> }
> + /* XXX Really fallthru? */
> + /* FALLTHRU */
> case MULT_EXPR:
> case TRUNC_DIV_EXPR:
> if (ARITHMETIC_TYPE_P (type1) && ARITHMETIC_TYPE_P (type2))
> --- gcc/gcc/cp/cxx-pretty-print.c
> +++ gcc/gcc/cp/cxx-pretty-print.c
> @@ -142,6 +142,8 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t)
>
> case OVERLOAD:
> t = OVL_CURRENT (t);
> + /* XXX Really fallthru? */
> + /* FALLTHRU */
> case VAR_DECL:
> case PARM_DECL:
> case CONST_DECL:
> --- gcc/gcc/cp/parser.c
> +++ gcc/gcc/cp/parser.c
> @@ -3488,6 +3488,8 @@ cp_parser_skip_to_end_of_statement (cp_parser* parser)
> cp_lexer_consume_token (parser->lexer);
> return;
> }
> + /* XXX Really fallthru? */
> + /* FALLTHRU */
>
> case CPP_OPEN_BRACE:
> ++nesting_depth;
> @@ -27640,6 +27646,8 @@ cp_parser_cache_defarg (cp_parser *parser, bool nsdmi)
> parser->in_template_argument_list_p = saved_italp;
> break;
> }
> + /* XXX Really fallthru? */
> + /* FALLTHRU */
> case CPP_CLOSE_PAREN:
> case CPP_ELLIPSIS:
> /* If we run into a non-nested `;', `}', or `]',
> --- gcc/gcc/tree-complex.c
> +++ gcc/gcc/tree-complex.c
> @@ -1336,6 +1336,8 @@ expand_complex_division (gimple_stmt_iterator *gsi, tree inner_type,
> rr = gimplify_build2 (gsi, code, inner_type, ai, bi);
> ri = gimplify_build2 (gsi, code, inner_type, ar, bi);
> ri = gimplify_build1 (gsi, NEGATE_EXPR, inner_type, ri);
> + /* XXX Really fallthru? */
> + /* FALLTHRU */
>
Nope, looks like a bug to me.
Richard.
> case PAIR (ONLY_REAL, VARYING):
> case PAIR (ONLY_IMAG, VARYING):
> --- gcc/libcpp/pch.c
> +++ gcc/libcpp/pch.c
> @@ -55,6 +55,8 @@ write_macdef (cpp_reader *pfile, cpp_hashnode *hn, void *file_p)
> case NT_VOID:
> if (! (hn->flags & NODE_POISONED))
> return 1;
> + /* XXX Really fallthru? */
> + /* FALLTHRU */
>
> case NT_MACRO:
> if ((hn->flags & NODE_BUILTIN)
>
> Marek
>
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)