diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-26 15:35:20 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-26 15:35:20 +0000 |
commit | f28dc0d7c91fb899a94c245007e4482dacd1fcf5 (patch) | |
tree | cc0132c42367e3a27e17b5763445fe2984bf8bcc /gcc/stmt.c | |
parent | 9c4874fcee3737eea25a2447a500c65481a326f8 (diff) | |
download | ppe42-gcc-f28dc0d7c91fb899a94c245007e4482dacd1fcf5.tar.gz ppe42-gcc-f28dc0d7c91fb899a94c245007e4482dacd1fcf5.zip |
* stmt.c (expand_case): Remove code to handle SWITCH_EXPR with
a default case only.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89585 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c index 9570f2504e4..bb17fa2e4e6 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -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, |