]> gcc.gnu.org Git - gcc.git/commitdiff
Strenghten assumption about gswitch statements.
authorMartin Liska <mliska@suse.cz>
Wed, 29 Aug 2018 08:35:09 +0000 (10:35 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 29 Aug 2018 08:35:09 +0000 (08:35 +0000)
2018-08-29  Martin Liska  <mliska@suse.cz>

* tree-switch-conversion.c (switch_conversion::expand):
Strenghten assumption about gswitch statements.

From-SVN: r263947

gcc/ChangeLog
gcc/tree-switch-conversion.c

index 2c0f5023a2dc94aa76e7c8c2175ab3dda8000b25..68c213bb3ce1e7f3c8d50b569d32e610469c139f 100644 (file)
@@ -1,3 +1,8 @@
+2018-08-29  Martin Liska  <mliska@suse.cz>
+
+       * tree-switch-conversion.c (switch_conversion::expand):
+       Strenghten assumption about gswitch statements.
+
 2018-08-29  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/87117
index a31ff94b895d9ce5606e070295ad00fd96d6188a..7e4f34c71f8e86dd6702d04ea411061d2c87d8ad 100644 (file)
@@ -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);
 
This page took 0.095635 seconds and 5 git commands to generate.