stmt.c (expand_case): Remove code to handle SWITCH_EXPR with a default case only.
authorKazu Hirata <kazu@cs.umass.edu>
Tue, 26 Oct 2004 15:35:20 +0000 (15:35 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Tue, 26 Oct 2004 15:35:20 +0000 (15:35 +0000)
* stmt.c (expand_case): Remove code to handle SWITCH_EXPR with
a default case only.

From-SVN: r89585

gcc/ChangeLog
gcc/stmt.c

index bc2a4ecc2be100456206889f1e08bd848816c9c2..916baf24d4b814d1e14d326d1fcd84823ad59ea6 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-26  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * stmt.c (expand_case): Remove code to handle SWITCH_EXPR with
+       a default case only.
+
 2004-10-26  Aldy Hernandez  <aldyh@redhat.com>
 
        * config/rs6000/rs6000.c (rs6000_hard_regno_nregs): Adjust for
index 9570f2504e43d4adef9ac4f38a970eea5897de78..bb17fa2e4e6551f50d3ed8471f7e176fd3587525 100644 (file)
@@ -2419,27 +2419,24 @@ expand_case (tree exp)
               }
        }
 
-      /* Compute span of values.  */
-      if (count != 0)
-       range = fold (build2 (MINUS_EXPR, index_type, maxval, minval));
+      /* cleanup_tree_cfg removes all SWITCH_EXPR with a single
+        destination, such as one with a default case only.  */
+      gcc_assert (count != 0);
 
-      if (count == 0)
-       {
-         expand_expr (index_expr, const0_rtx, VOIDmode, 0);
-         emit_jump (default_label);
-       }
+      /* Compute span of values.  */
+      range = fold (build2 (MINUS_EXPR, index_type, maxval, minval));
 
       /* Try implementing this switch statement by a short sequence of
         bit-wise comparisons.  However, we let the binary-tree case
         below handle constant index expressions.  */
-      else if (CASE_USE_BIT_TESTS
-              && ! TREE_CONSTANT (index_expr)
-              && compare_tree_int (range, GET_MODE_BITSIZE (word_mode)) < 0
-              && compare_tree_int (range, 0) > 0
-              && lshift_cheap_p ()
-              && ((uniq == 1 && count >= 3)
-                  || (uniq == 2 && count >= 5)
-                  || (uniq == 3 && count >= 6)))
+      if (CASE_USE_BIT_TESTS
+         && ! TREE_CONSTANT (index_expr)
+         && compare_tree_int (range, GET_MODE_BITSIZE (word_mode)) < 0
+         && compare_tree_int (range, 0) > 0
+         && lshift_cheap_p ()
+         && ((uniq == 1 && count >= 3)
+             || (uniq == 2 && count >= 5)
+             || (uniq == 3 && count >= 6)))
        {
          /* Optimize the case where all the case values fit in a
             word without having to subtract MINVAL.  In this case,