From 2304d9e853191f29437cfc6b5326c6ba4b57b863 Mon Sep 17 00:00:00 2001 From: marxin Date: Wed, 29 Aug 2018 08:35:09 +0000 Subject: [PATCH] Strenghten assumption about gswitch statements. 2018-08-29 Martin Liska * tree-switch-conversion.c (switch_conversion::expand): Strenghten assumption about gswitch statements. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263947 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/tree-switch-conversion.c | 9 +-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c0f5023a2d..68c213bb3ce 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-08-29 Martin Liska + + * tree-switch-conversion.c (switch_conversion::expand): + Strenghten assumption about gswitch statements. + 2018-08-29 Richard Biener PR tree-optimization/87117 diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c index a31ff94b895..7e4f34c71f8 100644 --- a/gcc/tree-switch-conversion.c +++ b/gcc/tree-switch-conversion.c @@ -913,14 +913,7 @@ switch_conversion::expand (gswitch *swtch) /* Group case labels so that we get the right results from the heuristics that decide on the code generation approach for this switch. */ m_cfg_altered |= group_case_labels_stmt (swtch); - - /* If this switch is now a degenerate case with only a default label, - there is nothing left for us to do. */ - if (gimple_switch_num_labels (swtch) < 2) - { - m_reason = "switch is a degenerate case"; - return; - } + gcc_assert (gimple_switch_num_labels (swtch) >= 2); collect (swtch); -- 2.11.4.GIT