summaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authordaney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-11 23:55:45 +0000
committerdaney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-11 23:55:45 +0000
commitd2b48f0c58acd993a34ce2ab25166ef727a12cce (patch)
tree33e26cb48c7e5455995d1edba975d67cf78cad99 /gcc/cfgcleanup.c
parentf6e79f69bcfd79a673dc4ab19db9af5513c87dbb (diff)
downloadgcc-d2b48f0c58acd993a34ce2ab25166ef727a12cce.tar.gz
2009-06-11 David Daney <ddaney@caviumnetworks.com>
PR c/39252 * doc/extend.texi ( __builtin_unreachable): Document new builtin. * builtins.c (expand_builtin_unreachable): New function. (expand_builtin): Handle BUILT_IN_UNREACHABLE case. * builtins.def (BUILT_IN_UNREACHABLE): Add new builtin. * cfgcleanup.c (try_optimize_cfg): Delete empty blocks with no successors. * cfgrtl.c (rtl_verify_flow_info): Handle empty blocks when searching for missing barriers. 2009-06-11 David Daney <ddaney@caviumnetworks.com> PR c/39252 * gcc.dg/builtin-unreachable-1.c: New test. * gcc.dg/builtin-unreachable-2.c: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148403 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 8da967a4ee0..a8b38d72472 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1873,8 +1873,12 @@ try_optimize_cfg (int mode)
edge s;
bool changed_here = false;
- /* Delete trivially dead basic blocks. */
- if (EDGE_COUNT (b->preds) == 0)
+ /* Delete trivially dead basic blocks. This is either
+ blocks with no predecessors, or empty blocks with no
+ successors. Empty blocks may result from expanding
+ __builtin_unreachable (). */
+ if (EDGE_COUNT (b->preds) == 0
+ || (EDGE_COUNT (b->succs) == 0 && BB_HEAD (b) == BB_END (b)))
{
c = b->prev_bb;
if (dump_file)