aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-11-29 15:20:38 +0100
committerRichard Biener <rguenther@suse.de>2021-11-30 08:23:26 +0100
commit2acbc4eba33574a5e655c01d1be8b17fad0be535 (patch)
treee5ed1acaf3d7f9ea3efeef6958dcf97acd35c702 /gcc/c
parent6c7d489a1e6592bc73db03678c1231748fd7a126 (diff)
downloadgcc-2acbc4eba33574a5e655c01d1be8b17fad0be535.zip
gcc-2acbc4eba33574a5e655c01d1be8b17fad0be535.tar.gz
gcc-2acbc4eba33574a5e655c01d1be8b17fad0be535.tar.bz2
Avoid some -Wunreachable-code-ctrl
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. 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.
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/gimple-parser.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/gcc/c/gimple-parser.c b/gcc/c/gimple-parser.c
index 32f22db..f594a8c 100644
--- a/gcc/c/gimple-parser.c
+++ b/gcc/c/gimple-parser.c
@@ -1698,13 +1698,7 @@ c_parser_gimple_postfix_expression (gimple_parser &parser)
}
break;
}
- else
- {
- c_parser_error (parser, "expected expression");
- expr.set_error ();
- break;
- }
- break;
+ /* Fallthru. */
default:
c_parser_error (parser, "expected expression");
expr.set_error ();