diff options
author | Jeff Law <law@gcc.gnu.org> | 2005-03-10 21:52:42 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2005-03-10 21:52:42 -0700 |
commit | cbefb99c9944240c248e7aa8dcd9bfd2b7ecc864 (patch) | |
tree | b68e8b88fbd204957fa2a685eaa6985b21264dfc /gcc/stmt.c | |
parent | c0cbd601303809da24e1ea49b711193cba4815be (diff) | |
download | gcc-cbefb99c9944240c248e7aa8dcd9bfd2b7ecc864.zip gcc-cbefb99c9944240c248e7aa8dcd9bfd2b7ecc864.tar.gz gcc-cbefb99c9944240c248e7aa8dcd9bfd2b7ecc864.tar.bz2 |
re PR tree-optimization/15784 (fold misses binary optimization)
PR tree-optimization/15784
* fold-const.c (fold): Fold ~A + 1 to -A. Fold -A - 1
and -1 - A to ~A.
* stmt.c (expand_case): Don't change index_type. Convert minval
to the proper type.
From-SVN: r96289
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -2424,7 +2424,7 @@ expand_case (tree exp) if (compare_tree_int (minval, 0) > 0 && compare_tree_int (maxval, GET_MODE_BITSIZE (word_mode)) < 0) { - minval = integer_zero_node; + minval = fold_convert (index_type, integer_zero_node); range = maxval; } emit_case_bit_tests (index_type, index_expr, minval, range, @@ -2502,7 +2502,6 @@ expand_case (tree exp) table_label, default_label)) { bool ok; - index_type = integer_type_node; /* Index jumptables from zero for suitable values of minval to avoid a subtraction. */ @@ -2510,7 +2509,7 @@ expand_case (tree exp) && compare_tree_int (minval, 0) > 0 && compare_tree_int (minval, 3) < 0) { - minval = integer_zero_node; + minval = fold_convert (index_type, integer_zero_node); range = maxval; } |