aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const-call.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-11-24 15:57:03 +0100
committerRichard Biener <rguenther@suse.de>2021-11-29 11:18:35 +0100
commita3b31fe3692894e80de16b4059a89a309e409687 (patch)
treec6c945f5d3d893cb2ac000b12f07854eae1c53ce /gcc/fold-const-call.c
parent16507dea753527d073f1cfb7200c6612a7fa44aa (diff)
downloadgcc-a3b31fe3692894e80de16b4059a89a309e409687.zip
gcc-a3b31fe3692894e80de16b4059a89a309e409687.tar.gz
gcc-a3b31fe3692894e80de16b4059a89a309e409687.tar.bz2
Remove unreachable gcc_unreachable () at the end of functions
It seems to be a style to place gcc_unreachable () after a switch that handles all cases with every case returning. Those are unreachable (well, yes!), so they will be elided at CFG construction time and the middle-end will place another __builtin_unreachable "after" them to note the path doesn't lead to a return when the function is not declared void. So IMHO those explicit gcc_unreachable () serve no purpose, if they could be replaced by a comment. But since all cases cover switches not handling a case or not returning will likely cause some diagnostic to be emitted which is better than running into an ICE only at runtime. 2021-11-24 Richard Biener <rguenther@suse.de> * tree.h (reverse_storage_order_for_component_p): Remove spurious gcc_unreachable. * cfganal.c (dfs_find_deadend): Likewise. * fold-const-call.c (fold_const_logb): Likewise. (fold_const_significand): Likewise. * gimple-ssa-store-merging.c (lhs_valid_for_store_merging_p): Likewise. gcc/c-family/ * c-format.c (check_format_string): Remove spurious gcc_unreachable.
Diffstat (limited to 'gcc/fold-const-call.c')
-rw-r--r--gcc/fold-const-call.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/gcc/fold-const-call.c b/gcc/fold-const-call.c
index d6cb9b1..c542e78 100644
--- a/gcc/fold-const-call.c
+++ b/gcc/fold-const-call.c
@@ -429,7 +429,6 @@ fold_const_logb (real_value *result, const real_value *arg,
}
return false;
}
- gcc_unreachable ();
}
/* Try to evaluate:
@@ -463,7 +462,6 @@ fold_const_significand (real_value *result, const real_value *arg,
}
return false;
}
- gcc_unreachable ();
}
/* Try to evaluate: