[PATCH] Avoid some -Wunreachable-code-ctrl

Jeff Law jeffreyalaw@gmail.com
Mon Nov 29 15:53:21 GMT 2021



On 11/29/2021 8:03 AM, Richard Biener via Gcc-patches wrote:
> This cleans up unreachable code diagnosed by -Wunreachable-code-ctrl.
> It largely follows the previous series but discovers a few extra
> cases, namely dead code after break or continue or loops without
> exits.
>
> Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
>
> Richard.
>
> 2021-11-29  Richard Biener  <rguenther@suse.de>
>
> gcc/c/
> 	* gimple-parser.c (c_parser_gimple_postfix_expression):
> 	avoid unreachable code after break.
>
> gcc/
> 	* cfgrtl.c (skip_insns_after_block): Refactor code to
> 	be more easily readable.
> 	* expr.c (op_by_pieces_d::run): Remove unreachable
> 	assert.
> 	* sched-deps.c (sched_analyze): Remove unreachable
> 	gcc_unreachable.
> 	* sel-sched-ir.c (in_same_ebb_p): Likewise.
> 	* tree-ssa-alias.c (nonoverlapping_refs_since_match_p):
> 	Remove unreachable code.
> 	* tree-vect-slp.c (vectorize_slp_instance_root_stmt):
> 	Refactor to avoid unreachable loop iteration.
> 	* tree.c (walk_tree_1): Remove unreachable break.
> 	* vec-perm-indices.c (vec_perm_indices::series_p): Remove
> 	unreachable return.
>
> gcc/cp/
> 	* parser.c (cp_parser_postfix_expression): Remove
> 	unreachable code.
> 	* pt.c (tsubst_expr): Remove unreachable breaks.
>
> gcc/fortran/
> 	* frontend-passes.c (gfc_expr_walker): Remove unreachable
> 	break.
> 	* scanner.c (skip_fixed_comments): Remove unreachable
> 	gcc_unreachable.
> 	* trans-expr.c (gfc_expr_is_variable): Refactor to make
> 	control flow more obvious.
OK
jeff



More information about the Gcc-patches mailing list